Index: ash/accelerators/accelerator_controller.cc |
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc |
index de85b561cb77ebcc209c724e667cb393562e497e..53444e9134d23ae25eca44e760419ed6f59ce503 100644 |
--- a/ash/accelerators/accelerator_controller.cc |
+++ b/ash/accelerators/accelerator_controller.cc |
@@ -86,6 +86,11 @@ bool DebugShortcutsEnabled() { |
#endif |
} |
+bool OverviewEnabled() { |
+ return !CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kAshDisableOverviewMode); |
+} |
+ |
bool HandleCycleWindowMRU(WindowCycleController::Direction direction, |
bool is_alt_down) { |
Shell::GetInstance()-> |
@@ -524,24 +529,19 @@ bool AcceleratorController::PerformAction(int action, |
case CYCLE_BACKWARD_MRU: |
if (key_code == ui::VKEY_TAB) |
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_PREVWINDOW_TAB); |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kAshEnableOverviewMode)) { |
+ if (OverviewEnabled()) |
return HandleCycleWindowOverviewMRU(WindowSelector::BACKWARD); |
- } |
return HandleCycleWindowMRU(WindowCycleController::BACKWARD, |
accelerator.IsAltDown()); |
case CYCLE_FORWARD_MRU: |
if (key_code == ui::VKEY_TAB) |
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEXTWINDOW_TAB); |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kAshEnableOverviewMode)) { |
+ if (OverviewEnabled()) |
return HandleCycleWindowOverviewMRU(WindowSelector::FORWARD); |
- } |
return HandleCycleWindowMRU(WindowCycleController::FORWARD, |
accelerator.IsAltDown()); |
case CYCLE_BACKWARD_LINEAR: |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kAshEnableOverviewMode)) { |
+ if (OverviewEnabled()) { |
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_OVERVIEW_F5); |
ToggleOverviewMode(); |
return true; |
@@ -551,8 +551,7 @@ bool AcceleratorController::PerformAction(int action, |
HandleCycleWindowLinear(CYCLE_BACKWARD); |
return true; |
case CYCLE_FORWARD_LINEAR: |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kAshEnableOverviewMode)) { |
+ if (OverviewEnabled()) { |
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_OVERVIEW_F5); |
ToggleOverviewMode(); |
return true; |