Home | History | Annotate | Download | only in accelerators
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "ash/accelerators/accelerator_table.h"
      6 
      7 #include "base/basictypes.h"
      8 
      9 namespace ash {
     10 
     11 const AcceleratorData kAcceleratorData[] = {
     12   // We have to define 3 entries for Shift+Alt. VKEY_[LR]MENU might be sent to
     13   // the accelerator controller when RenderWidgetHostViewAura is focused, and
     14   // VKEY_MENU might be when it's not (e.g. when NativeWidgetAura is focused).
     15   { false, ui::VKEY_LMENU, ui::EF_SHIFT_DOWN, NEXT_IME },
     16   { false, ui::VKEY_MENU, ui::EF_SHIFT_DOWN, NEXT_IME },
     17   { false, ui::VKEY_RMENU, ui::EF_SHIFT_DOWN, NEXT_IME },
     18   // The same is true for Alt+Shift.
     19   { false, ui::VKEY_LSHIFT, ui::EF_ALT_DOWN, NEXT_IME },
     20   { false, ui::VKEY_SHIFT, ui::EF_ALT_DOWN, NEXT_IME },
     21   { false, ui::VKEY_RSHIFT, ui::EF_ALT_DOWN, NEXT_IME },
     22   // Single shift release turns off caps lock.
     23   { false, ui::VKEY_LSHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
     24   { false, ui::VKEY_SHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
     25   { false, ui::VKEY_RSHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
     26 
     27   { true, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, PREVIOUS_IME },
     28   { false, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, PREVIOUS_IME },
     29   // Shortcuts for Japanese IME.
     30   { true, ui::VKEY_CONVERT, ui::EF_NONE, SWITCH_IME },
     31   { true, ui::VKEY_NONCONVERT, ui::EF_NONE, SWITCH_IME },
     32   { true, ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE, SWITCH_IME },
     33   { true, ui::VKEY_DBE_DBCSCHAR, ui::EF_NONE, SWITCH_IME },
     34   // Shortcut for Koren IME.
     35   { true, ui::VKEY_HANGUL, ui::EF_NONE, SWITCH_IME },
     36 
     37   { true, ui::VKEY_TAB, ui::EF_ALT_DOWN, CYCLE_FORWARD_MRU },
     38   { true, ui::VKEY_TAB, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
     39     CYCLE_BACKWARD_MRU },
     40   { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_NONE,
     41       CYCLE_FORWARD_LINEAR },
     42 #if defined(OS_CHROMEOS)
     43   { true, ui::VKEY_BROWSER_SEARCH, ui::EF_NONE, TOGGLE_APP_LIST },
     44   { true, ui::VKEY_WLAN, ui::EF_NONE, TOGGLE_WIFI },
     45   { true, ui::VKEY_KBD_BRIGHTNESS_DOWN, ui::EF_NONE, KEYBOARD_BRIGHTNESS_DOWN },
     46   { true, ui::VKEY_KBD_BRIGHTNESS_UP, ui::EF_NONE, KEYBOARD_BRIGHTNESS_UP },
     47   // Maximize button.
     48   { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_CONTROL_DOWN, TOGGLE_MIRROR_MODE },
     49   { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_ALT_DOWN, SWAP_PRIMARY_DISPLAY },
     50   // Cycle windows button.
     51   { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_CONTROL_DOWN, TAKE_SCREENSHOT },
     52   { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
     53     TAKE_PARTIAL_SCREENSHOT },
     54   { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_NONE, BRIGHTNESS_DOWN },
     55   { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_ALT_DOWN, KEYBOARD_BRIGHTNESS_DOWN },
     56   { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_NONE, BRIGHTNESS_UP },
     57   { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_ALT_DOWN, KEYBOARD_BRIGHTNESS_UP },
     58   { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     59     MAGNIFY_SCREEN_ZOOM_OUT},
     60   { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     61     MAGNIFY_SCREEN_ZOOM_IN},
     62   { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, LOCK_SCREEN },
     63   // The lock key on Chrome OS keyboards produces F13 scancodes.
     64   { true, ui::VKEY_F13, ui::EF_NONE, LOCK_PRESSED },
     65   { false, ui::VKEY_F13, ui::EF_NONE, LOCK_RELEASED },
     66   { true, ui::VKEY_POWER, ui::EF_NONE, POWER_PRESSED },
     67   { false, ui::VKEY_POWER, ui::EF_NONE, POWER_RELEASED },
     68   { true, ui::VKEY_O, ui::EF_CONTROL_DOWN, OPEN_FILE_DIALOG },
     69   { true, ui::VKEY_M, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
     70     OPEN_FILE_MANAGER },
     71   { true, ui::VKEY_T, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, OPEN_CROSH },
     72   { true, ui::VKEY_G, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     73     DISABLE_GPU_WATCHDOG },
     74   { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     75     TOUCH_HUD_MODE_CHANGE },
     76   { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
     77     TOUCH_HUD_CLEAR },
     78   { true, ui::VKEY_9, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
     79     TOUCH_HUD_PROJECTION_TOGGLE },
     80   // Accessibility: Spoken feedback shortcuts. The first one is to toggle
     81   // spoken feedback on or off. The others are only valid when
     82   // spoken feedback is enabled.
     83   { true, ui::VKEY_Z, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     84     TOGGLE_SPOKEN_FEEDBACK },
     85   { true, ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN, SILENCE_SPOKEN_FEEDBACK},
     86 #endif  // defined(OS_CHROMEOS)
     87   { true, ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, OPEN_FEEDBACK_PAGE },
     88 #if !defined(OS_WIN)
     89   { true, ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, EXIT },
     90 #endif
     91   { true, ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
     92     NEW_INCOGNITO_WINDOW },
     93   { true, ui::VKEY_N, ui::EF_CONTROL_DOWN, NEW_WINDOW },
     94   { true, ui::VKEY_T, ui::EF_CONTROL_DOWN, NEW_TAB },
     95   { true, ui::VKEY_OEM_MINUS,
     96     ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_UP },
     97   { true, ui::VKEY_OEM_PLUS,
     98     ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_DOWN },
     99   { true, ui::VKEY_0,
    100     ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_RESET },
    101   { true, ui::VKEY_BROWSER_REFRESH,
    102     ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, ROTATE_SCREEN },
    103   { true, ui::VKEY_BROWSER_REFRESH,
    104     ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    105     ROTATE_WINDOW },
    106   { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_SHIFT_DOWN,
    107     CYCLE_BACKWARD_LINEAR },
    108   { true, ui::VKEY_T, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, RESTORE_TAB },
    109   { true, ui::VKEY_PRINT, ui::EF_NONE, TAKE_SCREENSHOT },
    110   // On Chrome OS, Search key is mapped to LWIN. The Search key binding should
    111   // act on release instead of press when using Search as a modifier key for
    112   // extended keyboard shortcuts.
    113   { false, ui::VKEY_LWIN, ui::EF_NONE, TOGGLE_APP_LIST },
    114   { false, ui::VKEY_LWIN, ui::EF_ALT_DOWN, TOGGLE_CAPS_LOCK },
    115   { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_NONE, TOGGLE_FULLSCREEN },
    116   { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_SHIFT_DOWN, TOGGLE_FULLSCREEN },
    117   { true, ui::VKEY_VOLUME_MUTE, ui::EF_NONE, VOLUME_MUTE },
    118   { true, ui::VKEY_VOLUME_DOWN, ui::EF_NONE, VOLUME_DOWN },
    119   { true, ui::VKEY_VOLUME_UP, ui::EF_NONE, VOLUME_UP },
    120   { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, FOCUS_LAUNCHER },
    121   { true, ui::VKEY_HELP, ui::EF_NONE, SHOW_KEYBOARD_OVERLAY },
    122   { true, ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    123     SHOW_KEYBOARD_OVERLAY },
    124   { true, ui::VKEY_OEM_2,
    125     ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    126     SHOW_KEYBOARD_OVERLAY },
    127   { true, ui::VKEY_F14, ui::EF_NONE, SHOW_KEYBOARD_OVERLAY },
    128   { true, ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
    129     SHOW_MESSAGE_CENTER_BUBBLE },
    130   { true, ui::VKEY_BROWSER_BACK,
    131     ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    132     SHOW_OAK },
    133   { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
    134     SHOW_SYSTEM_TRAY_BUBBLE },
    135   { true, ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, SHOW_TASK_MANAGER },
    136   { true, ui::VKEY_1, ui::EF_ALT_DOWN, LAUNCH_APP_0 },
    137   { true, ui::VKEY_2, ui::EF_ALT_DOWN, LAUNCH_APP_1 },
    138   { true, ui::VKEY_3, ui::EF_ALT_DOWN, LAUNCH_APP_2 },
    139   { true, ui::VKEY_4, ui::EF_ALT_DOWN, LAUNCH_APP_3 },
    140   { true, ui::VKEY_5, ui::EF_ALT_DOWN, LAUNCH_APP_4 },
    141   { true, ui::VKEY_6, ui::EF_ALT_DOWN, LAUNCH_APP_5 },
    142   { true, ui::VKEY_7, ui::EF_ALT_DOWN, LAUNCH_APP_6 },
    143   { true, ui::VKEY_8, ui::EF_ALT_DOWN, LAUNCH_APP_7 },
    144   { true, ui::VKEY_9, ui::EF_ALT_DOWN, LAUNCH_LAST_APP },
    145 
    146   // Window management shortcuts.
    147   { true, ui::VKEY_OEM_4, ui::EF_ALT_DOWN, WINDOW_SNAP_LEFT },
    148   { true, ui::VKEY_OEM_6, ui::EF_ALT_DOWN, WINDOW_SNAP_RIGHT },
    149   { true, ui::VKEY_OEM_MINUS, ui::EF_ALT_DOWN, WINDOW_MINIMIZE },
    150   // Convenience for users switching from Mac OS.
    151   { true, ui::VKEY_M, ui::EF_CONTROL_DOWN, WINDOW_MINIMIZE },
    152   { true, ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN, TOGGLE_MAXIMIZED },
    153   { true, ui::VKEY_OEM_PLUS, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
    154     WINDOW_POSITION_CENTER },
    155   { true, ui::VKEY_BROWSER_FORWARD, ui::EF_CONTROL_DOWN, FOCUS_NEXT_PANE },
    156   { true, ui::VKEY_BROWSER_BACK, ui::EF_CONTROL_DOWN, FOCUS_PREVIOUS_PANE },
    157 
    158   // Media Player shortcuts.
    159   { true, ui::VKEY_MEDIA_NEXT_TRACK, ui::EF_NONE, MEDIA_NEXT_TRACK},
    160   { true, ui::VKEY_MEDIA_PLAY_PAUSE, ui::EF_NONE, MEDIA_PLAY_PAUSE},
    161   { true, ui::VKEY_MEDIA_PREV_TRACK, ui::EF_NONE, MEDIA_PREV_TRACK},
    162 
    163   // Debugging shortcuts that need to be available to end-users in
    164   // release builds.
    165   { true, ui::VKEY_U, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
    166     PRINT_UI_HIERARCHIES },
    167 
    168   { false, ui::VKEY_HOME, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_PREVIOUS},
    169   { false, ui::VKEY_PRIOR, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_PREVIOUS},
    170   { false, ui::VKEY_END, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_NEXT},
    171   { false, ui::VKEY_NEXT, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_NEXT},
    172 
    173   // TODO(yusukes): Handle VKEY_MEDIA_STOP, and
    174   // VKEY_MEDIA_LAUNCH_MAIL.
    175 };
    176 
    177 const size_t kAcceleratorDataLength = arraysize(kAcceleratorData);
    178 
    179 #if !defined(NDEBUG)
    180 const AcceleratorData kDesktopAcceleratorData[] = {
    181 #if defined(OS_CHROMEOS)
    182   // Extra shortcut for debug build to control magnifier on linux desktop.
    183   { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_CONTROL_DOWN,
    184     MAGNIFY_SCREEN_ZOOM_OUT},
    185   { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN, MAGNIFY_SCREEN_ZOOM_IN},
    186   // Extra shortcuts to lock the screen on linux desktop.
    187   { true, ui::VKEY_L, ui::EF_ALT_DOWN, LOCK_SCREEN },
    188   { true, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_PRESSED },
    189   { false, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_RELEASED },
    190   { true, ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
    191     ADD_REMOVE_DISPLAY },
    192   { true, ui::VKEY_M, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
    193     TOGGLE_MIRROR_MODE },
    194   { true, ui::VKEY_W, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, TOGGLE_WIFI },
    195   // Extra shortcut for display swaping as alt-f4 is taken on linux desktop.
    196   { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
    197     SWAP_PRIMARY_DISPLAY },
    198 #endif
    199   // Extra shortcut to rotate/scale up/down the screen on linux desktop.
    200   { true, ui::VKEY_R,
    201     ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, ROTATE_SCREEN },
    202   // For testing on systems where Alt-Tab is already mapped.
    203   { true, ui::VKEY_W, ui::EF_ALT_DOWN, CYCLE_FORWARD_MRU },
    204 
    205   { true, ui::VKEY_F11, ui::EF_CONTROL_DOWN, TOGGLE_ROOT_WINDOW_FULL_SCREEN },
    206   { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
    207       CYCLE_BACKWARD_MRU },
    208   { true, ui::VKEY_B, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    209     TOGGLE_DESKTOP_BACKGROUND_MODE },
    210 };
    211 
    212 const size_t kDesktopAcceleratorDataLength = arraysize(kDesktopAcceleratorData);
    213 #endif
    214 
    215 const AcceleratorData kDebugAcceleratorData[] = {
    216   { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    217     PRINT_LAYER_HIERARCHY },
    218   { true, ui::VKEY_V, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    219     PRINT_VIEW_HIERARCHY },
    220   { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    221     PRINT_WINDOW_HIERARCHY },
    222   { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    223     DEBUG_TOGGLE_DEVICE_SCALE_FACTOR },
    224   { true, ui::VKEY_B, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    225     DEBUG_TOGGLE_SHOW_DEBUG_BORDERS },
    226   { true, ui::VKEY_F, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    227     DEBUG_TOGGLE_SHOW_FPS_COUNTER },
    228   { true, ui::VKEY_P, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    229     DEBUG_TOGGLE_SHOW_PAINT_RECTS },
    230 };
    231 
    232 const size_t kDebugAcceleratorDataLength = arraysize(kDebugAcceleratorData);
    233 
    234 const AcceleratorAction kReservedActions[] = {
    235   // Window cycling accelerators.
    236   CYCLE_BACKWARD_MRU,  // Shift+Alt+Tab
    237   CYCLE_FORWARD_MRU,  // Alt+Tab
    238 #if defined(OS_CHROMEOS)
    239   POWER_PRESSED,
    240   POWER_RELEASED,
    241 #endif
    242 };
    243 
    244 const size_t kReservedActionsLength = arraysize(kReservedActions);
    245 
    246 const AcceleratorAction kReservedDebugActions[] = {
    247   PRINT_LAYER_HIERARCHY,
    248   PRINT_VIEW_HIERARCHY,
    249   PRINT_WINDOW_HIERARCHY,
    250   DEBUG_TOGGLE_DEVICE_SCALE_FACTOR,
    251   DEBUG_TOGGLE_SHOW_DEBUG_BORDERS,
    252   DEBUG_TOGGLE_SHOW_FPS_COUNTER,
    253   DEBUG_TOGGLE_SHOW_PAINT_RECTS,
    254 };
    255 
    256 const size_t kReservedDebugActionsLength = arraysize(kReservedDebugActions);
    257 
    258 const AcceleratorAction kActionsAllowedAtLoginOrLockScreen[] = {
    259   BRIGHTNESS_DOWN,
    260   BRIGHTNESS_UP,
    261   DISABLE_CAPS_LOCK,
    262   KEYBOARD_BRIGHTNESS_DOWN,
    263   KEYBOARD_BRIGHTNESS_UP,
    264   MAGNIFY_SCREEN_ZOOM_IN,  // Control+F7
    265   MAGNIFY_SCREEN_ZOOM_OUT,  // Control+F6
    266   NEXT_IME,
    267   PREVIOUS_IME,
    268   PRINT_LAYER_HIERARCHY,
    269   PRINT_UI_HIERARCHIES,
    270   PRINT_VIEW_HIERARCHY,
    271   PRINT_WINDOW_HIERARCHY,
    272   ROTATE_WINDOW,
    273   SWITCH_IME,  // Switch to another IME depending on the accelerator.
    274   TAKE_PARTIAL_SCREENSHOT,
    275   TAKE_SCREENSHOT,
    276   TOGGLE_CAPS_LOCK,
    277   TOGGLE_WIFI,
    278   TOUCH_HUD_CLEAR,
    279   VOLUME_DOWN,
    280   VOLUME_MUTE,
    281   VOLUME_UP,
    282 #if defined(OS_CHROMEOS)
    283   TOGGLE_SPOKEN_FEEDBACK,
    284   ADD_REMOVE_DISPLAY,
    285   DISABLE_GPU_WATCHDOG,
    286   TOGGLE_MIRROR_MODE,
    287 #endif
    288 #if defined(OS_CHROMEOS) && !defined(NDEBUG)
    289   POWER_PRESSED,
    290   POWER_RELEASED,
    291 #endif  // defined(OS_CHROMEOS)
    292 };
    293 
    294 const size_t kActionsAllowedAtLoginOrLockScreenLength =
    295     arraysize(kActionsAllowedAtLoginOrLockScreen);
    296 
    297 const AcceleratorAction kActionsAllowedAtLockScreen[] = {
    298   EXIT,
    299 };
    300 
    301 const size_t kActionsAllowedAtLockScreenLength =
    302     arraysize(kActionsAllowedAtLockScreen);
    303 
    304 const AcceleratorAction kActionsAllowedAtModalWindow[] = {
    305   BRIGHTNESS_DOWN,
    306   BRIGHTNESS_UP,
    307   DISABLE_CAPS_LOCK,
    308   EXIT,
    309   KEYBOARD_BRIGHTNESS_DOWN,
    310   KEYBOARD_BRIGHTNESS_UP,
    311   MAGNIFY_SCREEN_ZOOM_IN,
    312   MAGNIFY_SCREEN_ZOOM_OUT,
    313   MEDIA_NEXT_TRACK,
    314   MEDIA_PLAY_PAUSE,
    315   MEDIA_PREV_TRACK,
    316   NEXT_IME,
    317   OPEN_FEEDBACK_PAGE,
    318   POWER_PRESSED,
    319   POWER_RELEASED,
    320   PREVIOUS_IME,
    321   PRINT_UI_HIERARCHIES,
    322   SHOW_KEYBOARD_OVERLAY,
    323   SWITCH_IME,
    324   TAKE_PARTIAL_SCREENSHOT,
    325   TAKE_SCREENSHOT,
    326   TOGGLE_CAPS_LOCK,
    327   TOGGLE_WIFI,
    328   VOLUME_DOWN,
    329   VOLUME_MUTE,
    330   VOLUME_UP,
    331 #if defined(OS_CHROMEOS)
    332   SWAP_PRIMARY_DISPLAY,
    333   TOGGLE_SPOKEN_FEEDBACK,
    334 #if !defined(NDEBUG)
    335   ADD_REMOVE_DISPLAY,
    336 #endif
    337   LOCK_SCREEN,
    338   TOGGLE_MIRROR_MODE,
    339 #endif
    340 };
    341 
    342 const size_t kActionsAllowedAtModalWindowLength =
    343     arraysize(kActionsAllowedAtModalWindow);
    344 
    345 const AcceleratorAction kNonrepeatableActions[] = {
    346   // TODO(mazda): Add other actions which should not be repeated.
    347   CYCLE_BACKWARD_LINEAR,
    348   CYCLE_BACKWARD_MRU,
    349   CYCLE_FORWARD_LINEAR,
    350   CYCLE_FORWARD_MRU,
    351   EXIT,
    352   PRINT_UI_HIERARCHIES,  // Don't fill the logs if the key is held down.
    353   ROTATE_SCREEN,
    354   ROTATE_WINDOW,
    355   SCALE_UI_UP,
    356   SCALE_UI_DOWN,
    357   SCALE_UI_RESET,
    358   TOGGLE_FULLSCREEN,
    359   TOGGLE_MAXIMIZED,
    360   WINDOW_MINIMIZE,
    361 };
    362 
    363 const size_t kNonrepeatableActionsLength =
    364     arraysize(kNonrepeatableActions);
    365 
    366 const AcceleratorAction kActionsAllowedInAppMode[] = {
    367   BRIGHTNESS_DOWN,
    368   BRIGHTNESS_UP,
    369   CYCLE_BACKWARD_LINEAR,
    370   CYCLE_BACKWARD_MRU,
    371   CYCLE_FORWARD_LINEAR,
    372   CYCLE_FORWARD_MRU,
    373   DISABLE_CAPS_LOCK,
    374   EXIT,
    375   KEYBOARD_BRIGHTNESS_DOWN,
    376   KEYBOARD_BRIGHTNESS_UP,
    377   MAGNIFY_SCREEN_ZOOM_IN,  // Control+F7
    378   MAGNIFY_SCREEN_ZOOM_OUT,  // Control+F6
    379   MEDIA_NEXT_TRACK,
    380   MEDIA_PLAY_PAUSE,
    381   MEDIA_PREV_TRACK,
    382   NEXT_IME,
    383   POWER_PRESSED,
    384   POWER_RELEASED,
    385   PREVIOUS_IME,
    386   PRINT_LAYER_HIERARCHY,
    387   PRINT_UI_HIERARCHIES,
    388   PRINT_VIEW_HIERARCHY,
    389   PRINT_WINDOW_HIERARCHY,
    390   ROTATE_SCREEN,
    391   SCALE_UI_DOWN,
    392   SCALE_UI_RESET,
    393   SCALE_UI_UP,
    394   SWITCH_IME,  // Switch to another IME depending on the accelerator.
    395   TOGGLE_CAPS_LOCK,
    396   TOGGLE_WIFI,
    397   TOUCH_HUD_CLEAR,
    398   VOLUME_DOWN,
    399   VOLUME_MUTE,
    400   VOLUME_UP,
    401 #if defined(OS_CHROMEOS)
    402   SWAP_PRIMARY_DISPLAY,
    403   TOGGLE_SPOKEN_FEEDBACK,
    404   ADD_REMOVE_DISPLAY,
    405   DISABLE_GPU_WATCHDOG,
    406   TOGGLE_MIRROR_MODE,
    407 #endif  // defined(OS_CHROMEOS)
    408 };
    409 
    410 const size_t kActionsAllowedInAppModeLength =
    411     arraysize(kActionsAllowedInAppMode);
    412 
    413 }  // namespace ash
    414