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, CYCLE_LINEAR },
     41 #if defined(OS_CHROMEOS)
     42   { true, ui::VKEY_BROWSER_SEARCH, ui::EF_NONE, TOGGLE_APP_LIST },
     43   { true, ui::VKEY_WLAN, ui::EF_NONE, TOGGLE_WIFI },
     44   { true, ui::VKEY_KBD_BRIGHTNESS_DOWN, ui::EF_NONE, KEYBOARD_BRIGHTNESS_DOWN },
     45   { true, ui::VKEY_KBD_BRIGHTNESS_UP, ui::EF_NONE, KEYBOARD_BRIGHTNESS_UP },
     46   // Maximize button.
     47   { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_CONTROL_DOWN, TOGGLE_MIRROR_MODE },
     48   { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_ALT_DOWN, SWAP_PRIMARY_DISPLAY },
     49   // Cycle windows button.
     50   { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_CONTROL_DOWN, TAKE_SCREENSHOT },
     51   { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
     52     TAKE_PARTIAL_SCREENSHOT },
     53   { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_NONE, BRIGHTNESS_DOWN },
     54   { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_ALT_DOWN, KEYBOARD_BRIGHTNESS_DOWN },
     55   { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_NONE, BRIGHTNESS_UP },
     56   { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_ALT_DOWN, KEYBOARD_BRIGHTNESS_UP },
     57   { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     58     MAGNIFY_SCREEN_ZOOM_OUT},
     59   { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     60     MAGNIFY_SCREEN_ZOOM_IN},
     61   { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, LOCK_SCREEN },
     62   // The lock key on Chrome OS keyboards produces F13 scancodes.
     63   { true, ui::VKEY_F13, ui::EF_NONE, LOCK_PRESSED },
     64   { false, ui::VKEY_F13, ui::EF_NONE, LOCK_RELEASED },
     65   { true, ui::VKEY_POWER, ui::EF_NONE, POWER_PRESSED },
     66   { false, ui::VKEY_POWER, ui::EF_NONE, POWER_RELEASED },
     67   { true, ui::VKEY_M, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
     68     OPEN_FILE_MANAGER },
     69   { true, ui::VKEY_T, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, OPEN_CROSH },
     70   { true, ui::VKEY_G, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     71     DISABLE_GPU_WATCHDOG },
     72   { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     73     TOUCH_HUD_MODE_CHANGE },
     74   { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
     75     TOUCH_HUD_CLEAR },
     76   { true, ui::VKEY_9, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
     77     TOUCH_HUD_PROJECTION_TOGGLE },
     78   // Accessibility: Spoken feedback shortcuts. The first one is to toggle
     79   // spoken feedback on or off. The others are only valid when
     80   // spoken feedback is enabled.
     81   { true, ui::VKEY_Z, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     82     TOGGLE_SPOKEN_FEEDBACK },
     83   { true, ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN, SILENCE_SPOKEN_FEEDBACK},
     84   { true, ui::VKEY_OEM_COMMA, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     85     SWITCH_TO_PREVIOUS_USER },
     86   { true, ui::VKEY_OEM_PERIOD, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
     87     SWITCH_TO_NEXT_USER },
     88 #endif  // defined(OS_CHROMEOS)
     89   { true, ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, OPEN_FEEDBACK_PAGE },
     90 #if !defined(OS_WIN)
     91   { true, ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, EXIT },
     92 #endif
     93   { true, ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
     94     NEW_INCOGNITO_WINDOW },
     95   { true, ui::VKEY_N, ui::EF_CONTROL_DOWN, NEW_WINDOW },
     96   { true, ui::VKEY_T, ui::EF_CONTROL_DOWN, NEW_TAB },
     97   { true, ui::VKEY_OEM_MINUS,
     98     ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_UP },
     99   { true, ui::VKEY_OEM_PLUS,
    100     ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_DOWN },
    101   { true, ui::VKEY_0,
    102     ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_RESET },
    103   { true, ui::VKEY_BROWSER_REFRESH,
    104     ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, ROTATE_SCREEN },
    105   { true, ui::VKEY_BROWSER_REFRESH,
    106     ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    107     ROTATE_WINDOW },
    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   // The same accelerator is defined in
    150   // c/b/ui/views/accelerator_table.cc in order for the web page to
    151   // intercept and process this shortcut. This accelerator is used if the
    152   // focused window isn't browser window nor web content.
    153   // TODO(stevet/jamescook): Remove this in M33, as well as the copy
    154   // referenced above. We want to move away from shortcuts bound to Ctrl
    155   // because web content often uses them.
    156   { true, ui::VKEY_M, ui::EF_CONTROL_DOWN, WINDOW_MINIMIZE },
    157   { true, ui::VKEY_OEM_MINUS, ui::EF_ALT_DOWN, WINDOW_MINIMIZE },
    158   { true, ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN, TOGGLE_MAXIMIZED },
    159   { true, ui::VKEY_OEM_PLUS, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
    160     WINDOW_POSITION_CENTER },
    161   { true, ui::VKEY_BROWSER_FORWARD, ui::EF_CONTROL_DOWN, FOCUS_NEXT_PANE },
    162   { true, ui::VKEY_BROWSER_BACK, ui::EF_CONTROL_DOWN, FOCUS_PREVIOUS_PANE },
    163 
    164   // Media Player shortcuts.
    165   { true, ui::VKEY_MEDIA_NEXT_TRACK, ui::EF_NONE, MEDIA_NEXT_TRACK},
    166   { true, ui::VKEY_MEDIA_PLAY_PAUSE, ui::EF_NONE, MEDIA_PLAY_PAUSE},
    167   { true, ui::VKEY_MEDIA_PREV_TRACK, ui::EF_NONE, MEDIA_PREV_TRACK},
    168 
    169   // Debugging shortcuts that need to be available to end-users in
    170   // release builds.
    171   { true, ui::VKEY_U, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
    172     PRINT_UI_HIERARCHIES },
    173 
    174   { false, ui::VKEY_HOME, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_PREVIOUS},
    175   { false, ui::VKEY_PRIOR, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_PREVIOUS},
    176   { false, ui::VKEY_END, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_NEXT},
    177   { false, ui::VKEY_NEXT, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_NEXT},
    178 
    179   // TODO(yusukes): Handle VKEY_MEDIA_STOP, and
    180   // VKEY_MEDIA_LAUNCH_MAIL.
    181 };
    182 
    183 const size_t kAcceleratorDataLength = arraysize(kAcceleratorData);
    184 
    185 #if !defined(NDEBUG)
    186 const AcceleratorData kDesktopAcceleratorData[] = {
    187 #if defined(OS_CHROMEOS)
    188   // Extra shortcut for debug build to control magnifier on linux desktop.
    189   { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_CONTROL_DOWN,
    190     MAGNIFY_SCREEN_ZOOM_OUT},
    191   { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN, MAGNIFY_SCREEN_ZOOM_IN},
    192   // Extra shortcuts to lock the screen on linux desktop.
    193   { true, ui::VKEY_L, ui::EF_ALT_DOWN, LOCK_SCREEN },
    194   { true, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_PRESSED },
    195   { false, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_RELEASED },
    196   { true, ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
    197     ADD_REMOVE_DISPLAY },
    198   { true, ui::VKEY_M, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
    199     TOGGLE_MIRROR_MODE },
    200   { true, ui::VKEY_W, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, TOGGLE_WIFI },
    201   // Extra shortcut for display swaping as alt-f4 is taken on linux desktop.
    202   { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
    203     SWAP_PRIMARY_DISPLAY },
    204 #endif
    205   // Extra shortcut to rotate/scale up/down the screen on linux desktop.
    206   { true, ui::VKEY_R,
    207     ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, ROTATE_SCREEN },
    208   // For testing on systems where Alt-Tab is already mapped.
    209   { true, ui::VKEY_W, ui::EF_ALT_DOWN, CYCLE_FORWARD_MRU },
    210 
    211   { true, ui::VKEY_F11, ui::EF_CONTROL_DOWN, TOGGLE_ROOT_WINDOW_FULL_SCREEN },
    212   { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
    213       CYCLE_BACKWARD_MRU },
    214   { true, ui::VKEY_B, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    215     TOGGLE_DESKTOP_BACKGROUND_MODE },
    216 };
    217 
    218 const size_t kDesktopAcceleratorDataLength = arraysize(kDesktopAcceleratorData);
    219 #endif
    220 
    221 const AcceleratorData kDebugAcceleratorData[] = {
    222   { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    223     PRINT_LAYER_HIERARCHY },
    224   { true, ui::VKEY_V, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    225     PRINT_VIEW_HIERARCHY },
    226   { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    227     PRINT_WINDOW_HIERARCHY },
    228   { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    229     DEBUG_TOGGLE_DEVICE_SCALE_FACTOR },
    230   { true, ui::VKEY_B, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    231     DEBUG_TOGGLE_SHOW_DEBUG_BORDERS },
    232   { true, ui::VKEY_F, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    233     DEBUG_TOGGLE_SHOW_FPS_COUNTER },
    234   { true, ui::VKEY_P, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
    235     DEBUG_TOGGLE_SHOW_PAINT_RECTS },
    236 };
    237 
    238 const size_t kDebugAcceleratorDataLength = arraysize(kDebugAcceleratorData);
    239 
    240 const AcceleratorAction kReservedActions[] = {
    241   // Window cycling accelerators.
    242   CYCLE_BACKWARD_MRU,  // Shift+Alt+Tab
    243   CYCLE_FORWARD_MRU,  // Alt+Tab
    244 #if defined(OS_CHROMEOS)
    245   POWER_PRESSED,
    246   POWER_RELEASED,
    247 #endif
    248 };
    249 
    250 const size_t kReservedActionsLength = arraysize(kReservedActions);
    251 
    252 const AcceleratorAction kReservedDebugActions[] = {
    253   PRINT_LAYER_HIERARCHY,
    254   PRINT_VIEW_HIERARCHY,
    255   PRINT_WINDOW_HIERARCHY,
    256   DEBUG_TOGGLE_DEVICE_SCALE_FACTOR,
    257   DEBUG_TOGGLE_SHOW_DEBUG_BORDERS,
    258   DEBUG_TOGGLE_SHOW_FPS_COUNTER,
    259   DEBUG_TOGGLE_SHOW_PAINT_RECTS,
    260 };
    261 
    262 const size_t kReservedDebugActionsLength = arraysize(kReservedDebugActions);
    263 
    264 const AcceleratorAction kActionsAllowedAtLoginOrLockScreen[] = {
    265   BRIGHTNESS_DOWN,
    266   BRIGHTNESS_UP,
    267   DISABLE_CAPS_LOCK,
    268   KEYBOARD_BRIGHTNESS_DOWN,
    269   KEYBOARD_BRIGHTNESS_UP,
    270   MAGNIFY_SCREEN_ZOOM_IN,  // Control+F7
    271   MAGNIFY_SCREEN_ZOOM_OUT,  // Control+F6
    272   NEXT_IME,
    273   PREVIOUS_IME,
    274   PRINT_LAYER_HIERARCHY,
    275   PRINT_UI_HIERARCHIES,
    276   PRINT_VIEW_HIERARCHY,
    277   PRINT_WINDOW_HIERARCHY,
    278   ROTATE_WINDOW,
    279   SHOW_SYSTEM_TRAY_BUBBLE,
    280   SWITCH_IME,  // Switch to another IME depending on the accelerator.
    281   TAKE_PARTIAL_SCREENSHOT,
    282   TAKE_SCREENSHOT,
    283   TOGGLE_CAPS_LOCK,
    284   TOGGLE_WIFI,
    285   TOUCH_HUD_CLEAR,
    286   VOLUME_DOWN,
    287   VOLUME_MUTE,
    288   VOLUME_UP,
    289 #if defined(OS_CHROMEOS)
    290   TOGGLE_SPOKEN_FEEDBACK,
    291   ADD_REMOVE_DISPLAY,
    292   DISABLE_GPU_WATCHDOG,
    293   TOGGLE_MIRROR_MODE,
    294 #endif
    295 #if defined(OS_CHROMEOS) && !defined(NDEBUG)
    296   POWER_PRESSED,
    297   POWER_RELEASED,
    298 #endif  // defined(OS_CHROMEOS)
    299 };
    300 
    301 const size_t kActionsAllowedAtLoginOrLockScreenLength =
    302     arraysize(kActionsAllowedAtLoginOrLockScreen);
    303 
    304 const AcceleratorAction kActionsAllowedAtLockScreen[] = {
    305   EXIT,
    306 };
    307 
    308 const size_t kActionsAllowedAtLockScreenLength =
    309     arraysize(kActionsAllowedAtLockScreen);
    310 
    311 const AcceleratorAction kActionsAllowedAtModalWindow[] = {
    312   BRIGHTNESS_DOWN,
    313   BRIGHTNESS_UP,
    314   DISABLE_CAPS_LOCK,
    315   EXIT,
    316   KEYBOARD_BRIGHTNESS_DOWN,
    317   KEYBOARD_BRIGHTNESS_UP,
    318   MAGNIFY_SCREEN_ZOOM_IN,
    319   MAGNIFY_SCREEN_ZOOM_OUT,
    320   MEDIA_NEXT_TRACK,
    321   MEDIA_PLAY_PAUSE,
    322   MEDIA_PREV_TRACK,
    323   NEXT_IME,
    324   OPEN_FEEDBACK_PAGE,
    325   POWER_PRESSED,
    326   POWER_RELEASED,
    327   PREVIOUS_IME,
    328   PRINT_UI_HIERARCHIES,
    329   SHOW_KEYBOARD_OVERLAY,
    330   SWITCH_IME,
    331   TAKE_PARTIAL_SCREENSHOT,
    332   TAKE_SCREENSHOT,
    333   TOGGLE_CAPS_LOCK,
    334   TOGGLE_WIFI,
    335   VOLUME_DOWN,
    336   VOLUME_MUTE,
    337   VOLUME_UP,
    338 #if defined(OS_CHROMEOS)
    339   SWAP_PRIMARY_DISPLAY,
    340   TOGGLE_SPOKEN_FEEDBACK,
    341 #if !defined(NDEBUG)
    342   ADD_REMOVE_DISPLAY,
    343 #endif
    344   LOCK_SCREEN,
    345   TOGGLE_MIRROR_MODE,
    346 #endif
    347 };
    348 
    349 const size_t kActionsAllowedAtModalWindowLength =
    350     arraysize(kActionsAllowedAtModalWindow);
    351 
    352 const AcceleratorAction kNonrepeatableActions[] = {
    353   // TODO(mazda): Add other actions which should not be repeated.
    354   CYCLE_BACKWARD_MRU,
    355   CYCLE_FORWARD_MRU,
    356   CYCLE_LINEAR,
    357   EXIT,
    358   PRINT_UI_HIERARCHIES,  // Don't fill the logs if the key is held down.
    359   ROTATE_SCREEN,
    360   ROTATE_WINDOW,
    361   SCALE_UI_UP,
    362   SCALE_UI_DOWN,
    363   SCALE_UI_RESET,
    364   TOGGLE_FULLSCREEN,
    365   TOGGLE_MAXIMIZED,
    366   WINDOW_MINIMIZE,
    367 };
    368 
    369 const size_t kNonrepeatableActionsLength =
    370     arraysize(kNonrepeatableActions);
    371 
    372 const AcceleratorAction kActionsAllowedInAppMode[] = {
    373   BRIGHTNESS_DOWN,
    374   BRIGHTNESS_UP,
    375   CYCLE_BACKWARD_MRU,
    376   CYCLE_FORWARD_MRU,
    377   CYCLE_LINEAR,
    378   DISABLE_CAPS_LOCK,
    379   KEYBOARD_BRIGHTNESS_DOWN,
    380   KEYBOARD_BRIGHTNESS_UP,
    381   MAGNIFY_SCREEN_ZOOM_IN,  // Control+F7
    382   MAGNIFY_SCREEN_ZOOM_OUT,  // Control+F6
    383   MEDIA_NEXT_TRACK,
    384   MEDIA_PLAY_PAUSE,
    385   MEDIA_PREV_TRACK,
    386   NEXT_IME,
    387   POWER_PRESSED,
    388   POWER_RELEASED,
    389   PREVIOUS_IME,
    390   PRINT_LAYER_HIERARCHY,
    391   PRINT_UI_HIERARCHIES,
    392   PRINT_VIEW_HIERARCHY,
    393   PRINT_WINDOW_HIERARCHY,
    394   ROTATE_SCREEN,
    395   SCALE_UI_DOWN,
    396   SCALE_UI_RESET,
    397   SCALE_UI_UP,
    398   SWITCH_IME,  // Switch to another IME depending on the accelerator.
    399   TOGGLE_CAPS_LOCK,
    400   TOGGLE_WIFI,
    401   TOUCH_HUD_CLEAR,
    402   VOLUME_DOWN,
    403   VOLUME_MUTE,
    404   VOLUME_UP,
    405 #if defined(OS_CHROMEOS)
    406   SWAP_PRIMARY_DISPLAY,
    407   TOGGLE_SPOKEN_FEEDBACK,
    408   ADD_REMOVE_DISPLAY,
    409   DISABLE_GPU_WATCHDOG,
    410   TOGGLE_MIRROR_MODE,
    411 #endif  // defined(OS_CHROMEOS)
    412 };
    413 
    414 const size_t kActionsAllowedInAppModeLength =
    415     arraysize(kActionsAllowedInAppMode);
    416 
    417 const AcceleratorAction kActionsNeedingWindow[] = {
    418     ACCESSIBLE_FOCUS_NEXT,
    419     ACCESSIBLE_FOCUS_PREVIOUS,
    420     CYCLE_BACKWARD_MRU,
    421     CYCLE_FORWARD_MRU,
    422     CYCLE_LINEAR,
    423     WINDOW_SNAP_LEFT,
    424     WINDOW_SNAP_RIGHT,
    425     WINDOW_MINIMIZE,
    426     TOGGLE_FULLSCREEN,
    427     TOGGLE_MAXIMIZED,
    428     WINDOW_POSITION_CENTER,
    429     ROTATE_WINDOW,
    430 };
    431 
    432 const size_t kActionsNeedingWindowLength = arraysize(kActionsNeedingWindow);
    433 
    434 }  // namespace ash
    435