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

Unified Diff: chrome/browser/chromeos/system_key_event_listener.cc

Issue 9225004: Handle Caps Lock short cut (Shift+Search) in ash [part 2 of 2]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix, rebase 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
Index: chrome/browser/chromeos/system_key_event_listener.cc
diff --git a/chrome/browser/chromeos/system_key_event_listener.cc b/chrome/browser/chromeos/system_key_event_listener.cc
index 6740eafb5f2e9bb1feda7c279dae6ac7720d4b37..ffbb77e78bb626f219bedf28c10e4b7d0d9e8cb2 100644
--- a/chrome/browser/chromeos/system_key_event_listener.cc
+++ b/chrome/browser/chromeos/system_key_event_listener.cc
@@ -305,6 +305,7 @@ bool SystemKeyEventListener::ProcessedXEvent(XEvent* xevent) {
}
if (xevent->type == xkb_event_base_) {
+ // TODO(yusukes): Move this part to aura::RootWindowHost.
XkbEvent* xkey_event = reinterpret_cast<XkbEvent*>(xevent);
if (xkey_event->any.xkb_type == XkbStateNotify) {
input_method::ModifierLockStatus new_caps_lock_state =
@@ -338,7 +339,9 @@ bool SystemKeyEventListener::ProcessedXEvent(XEvent* xevent) {
if (keycode) {
const unsigned int state = (xevent->xkey.state & kSupportedModifiers);
+#if !defined(USE_AURA)
// Toggle Caps Lock if Shift and Search keys are pressed.
+ // When Aura is in use, the short cut is handled in Ash.
Daniel Erat 2012/01/23 16:42:43 nit: s/short cut/shortcut/
Yusuke Sato 2012/01/24 09:03:19 Done.
if (XKeycodeToKeysym(ui::GetXDisplay(), keycode, 0) == XK_Super_L) {
const bool shift_is_held = (state & ShiftMask);
const bool other_mods_are_held = (state & ~(ShiftMask | LockMask));
@@ -346,6 +349,7 @@ bool SystemKeyEventListener::ProcessedXEvent(XEvent* xevent) {
input_method_manager->GetXKeyboard()->SetCapsLockEnabled(
!caps_lock_is_on_);
}
+#endif
// Only doing non-Alt/Shift/Ctrl modified keys
if (!(state & (Mod1Mask | ShiftMask | ControlMask))) {

Powered by Google App Engine
This is Rietveld 408576698