diff options
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 5 | ||||
-rw-r--r-- | ash/accelerators/accelerator_table.cc | 12 | ||||
-rw-r--r-- | ash/accelerators/accelerator_table.h | 8 |
3 files changed, 24 insertions, 1 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index 175c79d..677e8a4 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -400,8 +400,11 @@ void AcceleratorController::Init() { RegisterAccelerators(kDesktopAcceleratorData, kDesktopAcceleratorDataLength); #endif - if (DebugShortcutsEnabled()) + if (DebugShortcutsEnabled()) { RegisterAccelerators(kDebugAcceleratorData, kDebugAcceleratorDataLength); + for (size_t i = 0; i < kReservedDebugActionsLength; ++i) + reserved_actions_.insert(kReservedDebugActions[i]); + } #if defined(OS_CHROMEOS) keyboard_brightness_control_delegate_.reset( diff --git a/ash/accelerators/accelerator_table.cc b/ash/accelerators/accelerator_table.cc index e60408e..835ac45 100644 --- a/ash/accelerators/accelerator_table.cc +++ b/ash/accelerators/accelerator_table.cc @@ -239,6 +239,18 @@ const AcceleratorAction kReservedActions[] = { const size_t kReservedActionsLength = arraysize(kReservedActions); +const AcceleratorAction kReservedDebugActions[] = { + PRINT_LAYER_HIERARCHY, + PRINT_VIEW_HIERARCHY, + PRINT_WINDOW_HIERARCHY, + DEBUG_TOGGLE_DEVICE_SCALE_FACTOR, + DEBUG_TOGGLE_SHOW_DEBUG_BORDERS, + DEBUG_TOGGLE_SHOW_FPS_COUNTER, + DEBUG_TOGGLE_SHOW_PAINT_RECTS, +}; + +const size_t kReservedDebugActionsLength = arraysize(kReservedDebugActions); + const AcceleratorAction kActionsAllowedAtLoginOrLockScreen[] = { BRIGHTNESS_DOWN, BRIGHTNESS_UP, diff --git a/ash/accelerators/accelerator_table.h b/ash/accelerators/accelerator_table.h index 7e5e456..563a7c5 100644 --- a/ash/accelerators/accelerator_table.h +++ b/ash/accelerators/accelerator_table.h @@ -142,6 +142,14 @@ ASH_EXPORT extern const AcceleratorAction kReservedActions[]; // The number of elements in kReservedActions. ASH_EXPORT extern const size_t kReservedActionsLength; +// Actions that should be handled very early in Ash unless the current target +// window is full-screen, these actions are only handled if +// DebugShortcutsEnabled is true (command line switch 'ash-debug-shortcuts'). +ASH_EXPORT extern const AcceleratorAction kReservedDebugActions[]; + +// The number of elements in kReservedDebugActions. +ASH_EXPORT extern const size_t kReservedDebugActionsLength; + // Actions allowed while user is not signed in or screen is locked. ASH_EXPORT extern const AcceleratorAction kActionsAllowedAtLoginOrLockScreen[]; |