Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2323863002: Separate debugging and developer accelerators (Closed)
Patch Set: Oshima's comments AND Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/accelerators/accelerator_controller.cc
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index c7c4e6e2fa99a199b51877aafa73a41dd9e4c092..bba35287b19d9bf996e52208423574d9f3515e2f 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -25,6 +25,7 @@
#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/system/volume_control_delegate.h"
#include "ash/common/system/web_notification/web_notification_tray.h"
+#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/common/wm/mru_window_tracker.h"
#include "ash/common/wm/overview/window_selector_controller.h"
#include "ash/common/wm/window_cycle_controller.h"
@@ -473,6 +474,13 @@ void HandleToggleSpokenFeedback() {
A11Y_NOTIFICATION_SHOW);
}
+void HandleToggleTouchView() {
+ MaximizeModeController* controller =
+ WmShell::Get()->maximize_mode_controller();
+ controller->EnableMaximizeModeWindowManager(
+ !controller->IsMaximizeModeWindowManagerEnabled());
+}
+
void HandleVolumeDown(const ui::Accelerator& accelerator) {
VolumeControlDelegate* volume_delegate =
WmShell::Get()->system_tray_delegate()->GetVolumeControlDelegate();
@@ -686,6 +694,14 @@ void AcceleratorController::Init() {
for (size_t i = 0; i < kDebugAcceleratorDataLength; ++i)
reserved_actions_.insert(kDebugAcceleratorData[i].action);
}
+
+ if (debug::DeveloperAcceleratorsEnabled()) {
+ RegisterAccelerators(kDeveloperAcceleratorData,
+ kDeveloperAcceleratorDataLength);
+ // Developer accelerators are also reserved.
+ for (size_t i = 0; i < kDeveloperAcceleratorDataLength; ++i)
+ reserved_actions_.insert(kDeveloperAcceleratorData[i].action);
+ }
}
void AcceleratorController::RegisterAccelerators(
@@ -767,7 +783,6 @@ bool AcceleratorController::CanPerformAction(
case DEBUG_SHOW_TOAST:
case DEBUG_TOGGLE_TOUCH_PAD:
case DEBUG_TOGGLE_TOUCH_SCREEN:
- case DEBUG_TOGGLE_TOUCH_VIEW:
return debug::DebugAcceleratorsEnabled();
case DISABLE_CAPS_LOCK:
return CanHandleDisableCapsLock(previous_accelerator);
@@ -780,6 +795,8 @@ bool AcceleratorController::CanPerformAction(
return CanHandleCycleUser();
case TOGGLE_CAPS_LOCK:
return CanHandleToggleCapsLock(accelerator, previous_accelerator);
+ case DEV_TOGGLE_TOUCH_VIEW:
+ return debug::DeveloperAcceleratorsEnabled();
#endif
case EXIT:
case FOCUS_NEXT_PANE:
@@ -985,9 +1002,11 @@ void AcceleratorController::PerformAction(AcceleratorAction action,
case DEBUG_SHOW_TOAST:
case DEBUG_TOGGLE_TOUCH_PAD:
case DEBUG_TOGGLE_TOUCH_SCREEN:
- case DEBUG_TOGGLE_TOUCH_VIEW:
debug::PerformDebugActionIfEnabled(action);
break;
+ case DEV_TOGGLE_TOUCH_VIEW:
+ HandleToggleTouchView();
+ break;
case DISABLE_CAPS_LOCK:
HandleDisableCapsLock();
break;

Powered by Google App Engine
This is Rietveld 408576698