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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 9124021: Adds Ctrl-Shift-Q support inside AppList (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed extraneous import Created 8 years, 11 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 8a736d3f740060dce75d8c272c9b93102db0d0e5..943d296d6231bae4bbe497173459dabcc7280827 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -9,6 +9,7 @@
#include "ash/launcher/launcher_model.h"
#include "ash/screenshot_delegate.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/window_cycle_controller.h"
#include "ui/aura/event.h"
@@ -25,6 +26,7 @@ namespace {
enum AcceleratorAction {
CYCLE_BACKWARD,
CYCLE_FORWARD,
+ EXIT,
TAKE_SCREENSHOT,
TOGGLE_CAPS_LOCK,
#if !defined(NDEBUG)
@@ -45,6 +47,7 @@ struct AcceleratorData {
{ ui::VKEY_TAB, false, false, true, CYCLE_FORWARD },
{ ui::VKEY_TAB, true, false, true, CYCLE_BACKWARD },
{ ui::VKEY_F5, false, false, false, CYCLE_FORWARD },
+ { ui::VKEY_Q, true, true, false, EXIT },
{ ui::VKEY_F5, true, false, false, CYCLE_BACKWARD },
{ ui::VKEY_F5, false, true, false, TAKE_SCREENSHOT },
{ ui::VKEY_PRINT, false, false, false, TAKE_SCREENSHOT },
@@ -68,6 +71,14 @@ bool HandleCycleWindow(ash::WindowCycleController::Direction direction,
return true;
}
+bool HandleExit() {
+ ash::ShellDelegate* delegate = ash::Shell::GetInstance()->delegate();
+ if (!delegate)
+ return false;
+ delegate->Exit();
+ return true;
+}
+
#if !defined(NDEBUG)
// Rotates the screen.
bool HandleRotateScreen() {
@@ -186,6 +197,8 @@ bool AcceleratorController::AcceleratorPressed(
case CYCLE_FORWARD:
return HandleCycleWindow(WindowCycleController::FORWARD,
accelerator.IsAltDown());
+ case EXIT:
+ return HandleExit();
case TAKE_SCREENSHOT:
if (screenshot_delegate_.get())
screenshot_delegate_->HandleTakeScreenshot();
« 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