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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 20415002: Add window overview mode behind --ash-enable-overview-mode flag to F5 key. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | ash/ash.gyp » ('j') | ash/wm/window_cycle_controller.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index b96c201cf62b92d68d3105f0f5a93ca84cb4fdde..19fba850bae85366c0a53920e97cd500cbb3e63b 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -95,7 +95,11 @@ bool HandleCycleWindowMRU(WindowCycleController::Direction direction,
void HandleCycleWindowLinear(CycleDirection direction) {
Shell::GetInstance()->
- window_cycle_controller()->HandleLinearCycleWindow();
+ window_cycle_controller()->HandleLinearCycleWindow();
+}
+
+void ToggleOverviewMode() {
+ Shell::GetInstance()->window_cycle_controller()->ToggleOverview();
}
bool HandleAccessibleFocusCycle(bool reverse) {
@@ -521,11 +525,23 @@ bool AcceleratorController::PerformAction(int action,
return HandleCycleWindowMRU(WindowCycleController::FORWARD,
accelerator.IsAltDown());
case CYCLE_BACKWARD_LINEAR:
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshEnableOverviewMode)) {
+ shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_OVERVIEW_F5);
+ ToggleOverviewMode();
+ return true;
+ }
if (key_code == ui::VKEY_MEDIA_LAUNCH_APP1)
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_PREVWINDOW_F5);
HandleCycleWindowLinear(CYCLE_BACKWARD);
return true;
case CYCLE_FORWARD_LINEAR:
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshEnableOverviewMode)) {
+ shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_OVERVIEW_F5);
+ ToggleOverviewMode();
+ return true;
+ }
if (key_code == ui::VKEY_MEDIA_LAUNCH_APP1)
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEXTWINDOW_F5);
HandleCycleWindowLinear(CYCLE_FORWARD);
« no previous file with comments | « no previous file | ash/ash.gyp » ('j') | ash/wm/window_cycle_controller.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698