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

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

Issue 10383301: Move modifier remapping code from X to Ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reverted ui/base/keycodes/keyboard_code_conversion_x.cc (this was just for debugging) Created 8 years, 7 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 | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/ui/views/ash/key_rewriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/preferences.cc
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index 376630b41bc3a91f244b0209f16b3a4b5311334e..6b6b41391d040b63438234ec4ba84c7897cd8b40 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -331,12 +331,6 @@ void Preferences::InitUserPrefs(PrefService* prefs) {
mozc_integer_prefs_[i].Init(
language_prefs::kMozcIntegerPrefs[i].pref_name, prefs, this);
}
- xkb_remap_search_key_to_.Init(
- prefs::kLanguageXkbRemapSearchKeyTo, prefs, this);
- xkb_remap_control_key_to_.Init(
- prefs::kLanguageXkbRemapControlKeyTo, prefs, this);
- xkb_remap_alt_key_to_.Init(
- prefs::kLanguageXkbRemapAltKeyTo, prefs, this);
xkb_auto_repeat_enabled_.Init(
prefs::kLanguageXkbAutoRepeatEnabled, prefs, this);
xkb_auto_repeat_delay_pref_.Init(
@@ -438,16 +432,6 @@ void Preferences::NotifyPrefChanged(const std::string* pref_name) {
// preferencs, we don't need to send this to ibus-daemon.
}
- // Here, we set up the the modifier key mapping. This has to be done
- // before changing the current keyboard layout, so that the modifier key
- // preference is properly preserved. For this reason, we should do this
- // before setting preload engines, that could change the current
- // keyboard layout as needed.
- if (!pref_name || (*pref_name == prefs::kLanguageXkbRemapSearchKeyTo ||
- *pref_name == prefs::kLanguageXkbRemapControlKeyTo ||
- *pref_name == prefs::kLanguageXkbRemapAltKeyTo)) {
- UpdateModifierKeyMapping();
- }
if (!pref_name || *pref_name == prefs::kLanguageXkbAutoRepeatEnabled) {
const bool enabled = xkb_auto_repeat_enabled_.GetValue();
input_method::XKeyboard::SetAutoRepeatEnabled(enabled);
@@ -663,34 +647,6 @@ void Preferences::SetInputMethodList() {
input_method_manager_->ChangeInputMethod(current_input_method_id);
}
-void Preferences::UpdateModifierKeyMapping() {
- const int search_remap = xkb_remap_search_key_to_.GetValue();
- const int control_remap = xkb_remap_control_key_to_.GetValue();
- const int alt_remap = xkb_remap_alt_key_to_.GetValue();
- if ((search_remap < input_method::kNumModifierKeys) && (search_remap >= 0) &&
- (control_remap < input_method::kNumModifierKeys) &&
- (control_remap >= 0) &&
- (alt_remap < input_method::kNumModifierKeys) && (alt_remap >= 0)) {
- input_method::ModifierMap modifier_map;
- modifier_map.push_back(
- input_method::ModifierKeyPair(
- input_method::kSearchKey,
- input_method::ModifierKey(search_remap)));
- modifier_map.push_back(
- input_method::ModifierKeyPair(
- input_method::kControlKey,
- input_method::ModifierKey(control_remap)));
- modifier_map.push_back(
- input_method::ModifierKeyPair(
- input_method::kAltKey,
- input_method::ModifierKey(alt_remap)));
- input_method_manager_->GetXKeyboard()->RemapModifierKeys(modifier_map);
- } else {
- LOG(ERROR) << "Failed to remap modifier keys. Unexpected value(s): "
- << search_remap << ", " << control_remap << ", " << alt_remap;
- }
-}
-
void Preferences::UpdateAutoRepeatRate() {
// Avoid setting repeat rate on desktop dev environment.
if (!base::chromeos::IsRunningOnChromeOS())
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/ui/views/ash/key_rewriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698