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

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: 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 d78512e243a25acc8fac21111cc2eb672ac8d5e8..da9963391dc717bd514fb554d2727716c5de9499 100644
--- a/chrome/browser/chromeos/system_key_event_listener.cc
+++ b/chrome/browser/chromeos/system_key_event_listener.cc
@@ -302,6 +302,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 =
@@ -335,7 +336,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 shortcut is handled in Ash.
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));
@@ -343,6 +346,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