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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 23534041: Enable overview mode by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't cycle with no windows. Created 7 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
« no previous file with comments | « no previous file | ash/ash_switches.h » ('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 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;
« no previous file with comments | « no previous file | ash/ash_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698