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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 9242003: Handle Caps Lock short cut (Shift+Search) in ash [part 1 of 2]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix 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 | « ash/accelerators/accelerator_controller.h ('k') | 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 71f85073cef03c4d6edb13d9cdfd3c44a8e2fca8..2a48859b43d2f6f3a97d225fbdb80b3bf8040897 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -4,6 +4,7 @@
#include "ash/accelerators/accelerator_controller.h"
+#include "ash/caps_lock_delegate.h"
#include "ash/launcher/launcher.h"
#include "ash/launcher/launcher_model.h"
#include "ash/screenshot_delegate.h"
@@ -25,6 +26,7 @@ enum AcceleratorAction {
CYCLE_BACKWARD,
CYCLE_FORWARD,
TAKE_SCREENSHOT,
+ TOGGLE_CAPS_LOCK,
#if !defined(NDEBUG)
ROTATE_SCREEN,
PRINT_LAYER_HIERARCHY,
@@ -46,6 +48,8 @@ struct AcceleratorData {
{ ui::VKEY_F5, true, false, false, CYCLE_BACKWARD },
{ ui::VKEY_F5, false, true, false, TAKE_SCREENSHOT },
{ ui::VKEY_PRINT, false, false, false, TAKE_SCREENSHOT },
+ // On Chrome OS, Search key is mapped to LWIN.
+ { ui::VKEY_LWIN, true, false, false, TOGGLE_CAPS_LOCK },
#if !defined(NDEBUG)
{ ui::VKEY_HOME, false, true, false, ROTATE_SCREEN },
{ ui::VKEY_F11, false, true, false, TOGGLE_ROOT_WINDOW_FULL_SCREEN },
@@ -162,6 +166,11 @@ void AcceleratorController::SetScreenshotDelegate(
screenshot_delegate_.reset(screenshot_delegate);
}
+void AcceleratorController::SetCapsLockDelegate(
+ scoped_ptr<CapsLockDelegate> caps_lock_delegate) {
+ caps_lock_delegate_.swap(caps_lock_delegate);
+}
+
////////////////////////////////////////////////////////////////////////////////
// AcceleratorController, ui::AcceleratorTarget implementation:
@@ -182,6 +191,10 @@ bool AcceleratorController::AcceleratorPressed(
screenshot_delegate_->HandleTakeScreenshot();
// Return true to prevent propagation of the key event.
return true;
+ case TOGGLE_CAPS_LOCK:
+ if (caps_lock_delegate_.get())
+ return caps_lock_delegate_->HandleToggleCapsLock();
+ break;
#if !defined(NDEBUG)
case ROTATE_SCREEN:
return HandleRotateScreen();
« no previous file with comments | « ash/accelerators/accelerator_controller.h ('k') | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698