summaryrefslogtreecommitdiffstats
path: root/ash/accelerators
diff options
context:
space:
mode:
authorharrym@chromium.org <harrym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-18 09:20:07 +0000
committerharrym@chromium.org <harrym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-18 09:20:07 +0000
commit97388a1838eb65cf984bf0a105f8719b475c1ffa (patch)
tree569d73f094accba928d88420add12ab6c04472c9 /ash/accelerators
parent370eaf1049617e245613f52610848d786bff1b84 (diff)
downloadchromium_src-97388a1838eb65cf984bf0a105f8719b475c1ffa.zip
chromium_src-97388a1838eb65cf984bf0a105f8719b475c1ffa.tar.gz
chromium_src-97388a1838eb65cf984bf0a105f8719b475c1ffa.tar.bz2
Reserve Debug Shortcuts
- Processes debug shortcuts earlier in input cycle to prevent some views from blocking them. BUG=157650 Review URL: https://chromiumcodereview.appspot.com/14845014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/accelerators')
-rw-r--r--ash/accelerators/accelerator_controller.cc5
-rw-r--r--ash/accelerators/accelerator_table.cc12
-rw-r--r--ash/accelerators/accelerator_table.h8
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[];