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

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: Remove implicit cast to bool. 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') | no next file with comments »
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 8b9f9d4c4cdcf3c3b5d0a2da7034290a7a2389c1..b44369162394fb30f4ef445f233d9f8c05b025d9 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -45,6 +45,7 @@
#include "ash/wm/power_button_controller.h"
#include "ash/wm/property_util.h"
#include "ash/wm/window_cycle_controller.h"
+#include "ash/wm/window_selector_controller.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/snap_sizer.h"
#include "base/bind.h"
@@ -95,7 +96,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_selector_controller()->ToggleOverview();
}
bool HandleAccessibleFocusCycle(bool reverse) {
@@ -521,11 +526,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698