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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 10388023: AcceleratorController::AcceleratorPressed() should return true whenever some action is taken (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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/accelerators/accelerator_controller_unittest.cc » ('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 4c1550d35ce84a575984a22b6199f3bc14f6acad..3f000d6a2faa5ee80df4f87803c133976457f955 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -321,10 +321,10 @@ bool AcceleratorController::AcceleratorPressed(
return true;
case SEARCH_KEY:
ash::Shell::GetInstance()->delegate()->Search();
- break;
+ return true;
case TOGGLE_APP_LIST:
ash::Shell::GetInstance()->ToggleAppList();
- break;
+ return true;
case TOGGLE_CAPS_LOCK:
if (caps_lock_delegate_.get())
return caps_lock_delegate_->HandleToggleCapsLock();
@@ -358,8 +358,11 @@ bool AcceleratorController::AcceleratorPressed(
return shell->focus_cycler()->FocusWidget(shell->tray()->GetWidget());
break;
case SHOW_OAK:
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshEnableOak))
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshEnableOak)) {
oak::ShowOakWindow();
+ return true;
+ }
break;
case NEXT_IME:
if (ime_control_delegate_.get())
@@ -375,31 +378,31 @@ bool AcceleratorController::AcceleratorPressed(
break;
case SELECT_WIN_0:
SwitchToWindow(0);
- break;
+ return true;
case SELECT_WIN_1:
SwitchToWindow(1);
- break;
+ return true;
case SELECT_WIN_2:
SwitchToWindow(2);
- break;
+ return true;
case SELECT_WIN_3:
SwitchToWindow(3);
- break;
+ return true;
case SELECT_WIN_4:
SwitchToWindow(4);
- break;
+ return true;
case SELECT_WIN_5:
SwitchToWindow(5);
- break;
+ return true;
case SELECT_WIN_6:
SwitchToWindow(6);
- break;
+ return true;
case SELECT_WIN_7:
SwitchToWindow(7);
- break;
+ return true;
case SELECT_LAST_WIN:
SwitchToWindow(-1);
- break;
+ return true;
case WINDOW_SNAP_LEFT:
case WINDOW_SNAP_RIGHT: {
aura::Window* window = wm::GetActiveWindow();
@@ -411,12 +414,14 @@ bool AcceleratorController::AcceleratorPressed(
internal::SnapSizer::RIGHT_EDGE,
shell->GetGridSize());
window->SetBounds(sizer.GetSnapBounds(window->bounds()));
- break;
+ return true;
}
case WINDOW_MINIMIZE: {
aura::Window* window = wm::GetActiveWindow();
- if (window)
+ if (window) {
wm::MinimizeWindow(window);
+ return true;
+ }
break;
}
case WINDOW_MAXIMIZE_RESTORE: {
@@ -426,13 +431,16 @@ bool AcceleratorController::AcceleratorPressed(
wm::RestoreWindow(window);
else
wm::MaximizeWindow(window);
+ return true;
}
break;
}
case WINDOW_POSITION_CENTER: {
aura::Window* window = wm::GetActiveWindow();
- if (window)
+ if (window) {
wm::CenterWindow(window);
+ return true;
+ }
break;
}
case ROTATE_WINDOWS:
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698