Skip to content

Commit

Permalink
shortcuts: Update app to match categorization.
Browse files Browse the repository at this point in the history
* Arrange accelerators in proper category and order, remove some
  some accelerators that are not in the final list.
* Update enum for AcceleratorCategory and AcceleratorSubcategory.
* Update strings, unit_tests and fake data.

Bug: b:216049298
Test: browser_tests ShortcutCustomizationApp*
Change-Id: Ia68a0142509bd23bbe5df0441f3a54ce709fe0b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4229733
Commit-Queue: Longbo Wei <longbowei@google.com>
Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1103696}
  • Loading branch information
Longbo Wei authored and Chromium LUCI CQ committed Feb 10, 2023
1 parent 94b4e22 commit c102bbc
Show file tree
Hide file tree
Showing 11 changed files with 600 additions and 582 deletions.
16 changes: 2 additions & 14 deletions ash/ash_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -3315,9 +3315,6 @@ Connect your device to power.
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_ROTATE_SCREEN" translateable="false" desc="Label for accelerator action - Rotate window 90 degrees clockwise.">
Rotate window 90 degrees clockwise
</message>
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_ROTATE_WINDOW" translateable="false" desc="Label for accelerator action - Rotate window.">
Rotate window
</message>
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_SCALE_UI_DOWN" translateable="false" desc="Label for accelerator action - Zoom in on screen.">
Zoom in on screen
</message>
Expand Down Expand Up @@ -3411,9 +3408,6 @@ Connect your device to power.
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_TOGGLE_MAXIMIZED" translateable="false" desc="Label for accelerator action - Maximize window.">
Maximize window
</message>
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_TOGGLE_MESSAGE_CENTER_BUBBLE" translateable="false" desc="Label for accelerator action - See notifications.">
See notifications
</message>
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_TOGGLE_MIRROR_MODE" translateable="false" desc="Label for accelerator action - Mirror monitors.">
Mirror monitors
</message>
Expand All @@ -3429,9 +3423,6 @@ Connect your device to power.
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_TOGGLE_SPOKEN_FEEDBACK" translateable="false" desc="Label for accelerator action - Turn ChromeVox (spoken feedback) on or off.">
Turn ChromeVox (spoken feedback) on or off
</message>
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_TOGGLE_SYSTEM_TRAY_BUBBLE" translateable="false" desc="Label for accelerator action - Open system settings.">
Open system settings
</message>
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_TOGGLE_WIFI" translateable="false" desc="Label for accelerator action - Turn wifi on or off.">
Turn wifi on or off
</message>
Expand All @@ -3447,8 +3438,8 @@ Connect your device to power.
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_VOLUME_DOWN" translateable="false" desc="Label for accelerator action - Turn volume down.">
Turn volume down
</message>
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_VOLUME_MUTE" translateable="false" desc="Label for accelerator action - Turn volume down.">
Turn volume up
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_VOLUME_MUTE" translateable="false" desc="Label for accelerator action - Mute sound.">
Mute sound
</message>
<message name="IDS_ASH_ACCELERATOR_DESCRIPTION_VOLUME_UP" translateable="false" desc="Label for accelerator action - Turn volume up.">
Turn volume up
Expand Down Expand Up @@ -3575,9 +3566,6 @@ Connect your device to power.
</message>
<message name="IDS_BROWSER_ACCELERATOR_DESCRIPTION_CLEAR_BROWSING_DATA" translateable="false" desc="Label for accelerator action - Clear browsing data.">
Clear browsing data
</message>
<message name="IDS_BROWSER_ACCELERATOR_DESCRIPTION_CLOSE_FIND_OR_STOP" translateable="false" desc="Label for accelerator action - Close any open find window or stop the loading of your current page.">
Close any open find window or stop the loading of your current page
</message>
<message name="IDS_BROWSER_ACCELERATOR_DESCRIPTION_FOCUS_BOOKMARKS" translateable="false" desc="Label for accelerator action - Focus on or Highlight the bookmarks bar (if shown).">
Focus on or Highlight the bookmarks bar (if shown)
Expand Down
32 changes: 22 additions & 10 deletions ash/public/mojom/accelerator_info.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ enum AcceleratorLayoutStyle {
};

// Enum of top-level accelerator categories. Used in the UI for categorization.
// TODO(jimmyxgong): These are not the final enums, update once final categories
// are available.
enum AcceleratorCategory {
kTabsAndWindows,
kPageAndWebBrowser,
kSystemAndDisplaySettings,
kTextEditing,
kGeneral,
kDevice,
kBrowser,
kText,
kWindowsAndDesks,
kAccessibility,
kDebug,
kDeveloper,
Expand All @@ -80,12 +79,25 @@ enum AcceleratorCategory {

// Enum of secondary-level accelerator categories. Used in the UI for
// categorization.
// TODO(jimmyxgong): These are not the final enums, update once final
// subcategories are available.
enum AcceleratorSubcategory {
kGeneralControls,
kApps,
kMedia,
kInputs,
kDisplay,
kGeneral,
kSystemControls,
kSystemApps,
kBrowserNavigation,
kPages,
kTabs,
kBookmarks,
kDeveloperTools,
kTextNavigation,
kTextEditing,
kWindows,
kDesks,
kChromeVox,
kVisibility,
kAccessibilityNavigation,
kSixPackKeys,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,9 @@ const NonConfigurableActionsMap& GetNonConfigurableActionsMap() {
// NonConfigurableAcceleratorDetails(
// {ui::Accelerator(ui::VKEY_LEFT, ui::EF_COMMAND_DOWN)})},
{NonConfigurableActions::kBrowserNextPane,
NonConfigurableAcceleratorDetails({ui::Accelerator(
ui::VKEY_PRIOR, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN)})},
NonConfigurableAcceleratorDetails(
{ui::Accelerator(ui::VKEY_BROWSER_BACK,
ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN)})},
{NonConfigurableActions::kAmbientOpenRightClickMenu,
NonConfigurableAcceleratorDetails({ui::Accelerator(
ui::VKEY_VOLUME_UP, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN)})},
Expand Down

0 comments on commit c102bbc

Please sign in to comment.