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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 9132004: Makes Ctrl-Shift-L work in AppList (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed accelerator_table 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..338ee89471705b0f0cc09abff45956c752c10adc 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,9 @@ namespace {
enum AcceleratorAction {
CYCLE_BACKWARD,
CYCLE_FORWARD,
+#if defined(OS_CHROMEOS)
+ LOCK_SCREEN,
+#endif
TAKE_SCREENSHOT,
TOGGLE_CAPS_LOCK,
#if !defined(NDEBUG)
@@ -45,6 +49,9 @@ 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 },
+#if defined(OS_CHROMEOS)
+ { ui::VKEY_L, true, true, false, LOCK_SCREEN },
+#endif
{ 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 +75,16 @@ bool HandleCycleWindow(ash::WindowCycleController::Direction direction,
return true;
}
+#if defined(OS_CHROMEOS)
+bool HandleLock() {
+ ash::ShellDelegate* delegate = ash::Shell::GetInstance()->delegate();
+ if (!delegate)
+ return false;
+ delegate->LockScreen();
+ return true;
+}
+#endif
+
#if !defined(NDEBUG)
// Rotates the screen.
bool HandleRotateScreen() {
@@ -195,6 +212,10 @@ bool AcceleratorController::AcceleratorPressed(
if (caps_lock_delegate_.get())
return caps_lock_delegate_->HandleToggleCapsLock();
break;
+#if defined(OS_CHROMEOS)
+ case LOCK_SCREEN:
+ return HandleLock();
+#endif
#if !defined(NDEBUG)
case ROTATE_SCREEN:
return HandleRotateScreen();
« 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