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

Unified Diff: chrome/browser/ui/ash/event_rewriter.cc

Issue 11346028: Allow Caps Lock to be remapped [part 2 of 2] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 2 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/ui/ash/event_rewriter.cc
diff --git a/chrome/browser/ui/ash/event_rewriter.cc b/chrome/browser/ui/ash/event_rewriter.cc
index b836f1a543ab037778e3c406e1047e9827ad107a..a43ce5476f3c2df6f6fc28348aa6716c0b680757 100644
--- a/chrome/browser/ui/ash/event_rewriter.cc
+++ b/chrome/browser/ui/ash/event_rewriter.cc
@@ -25,11 +25,13 @@
#undef Status
#include "base/chromeos/chromeos_version.h"
+#include "base/command_line.h"
#include "chrome/browser/chromeos/input_method/input_method_manager.h"
#include "chrome/browser/chromeos/input_method/xkeyboard.h"
#include "chrome/browser/chromeos/login/base_login_display_host.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "ui/base/keycodes/keyboard_code_conversion_x.h"
#include "ui/base/x/x11_util.h"
@@ -113,12 +115,14 @@ bool IsRight(KeySym native_keysym) {
}
bool ShouldRemapCapsLock() {
- // Since both German Neo2 XKB layout and Caps Lock depend on Mod3Mask, it's
- // not possible to make both features work. For now, we don't remap Mod3Mask
- // when Neo2 is in use.
- // TODO(yusukes): Remove the restriction.
- return InputMethodManager::GetInstance()->GetCurrentInputMethod().id() !=
- kNeo2LayoutId;
+ return !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kHasChromeOSKeyboard) &&
+ // Since both German Neo2 XKB layout and Caps Lock depend on Mod3Mask,
+ // it's not possible to make both features work. For now, we don't remap
+ // Mod3Mask when Neo2 is in use.
+ // TODO(yusukes): Remove the restriction.
+ (InputMethodManager::GetInstance()->GetCurrentInputMethod().id() !=
+ kNeo2LayoutId);
}
#endif

Powered by Google App Engine
This is Rietveld 408576698