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

Side by Side Diff: chrome/browser/chromeos/preferences.cc

Issue 11558017: Decouple input_method from BrowserThread (and content/). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/preferences.h" 5 #include "chrome/browser/chromeos/preferences.h"
6 6
7 #include "base/chromeos/chromeos_version.h" 7 #include "base/chromeos/chromeos_version.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 default_download_to_drive); 518 default_download_to_drive);
519 } 519 }
520 520
521 if (!pref_name || *pref_name == prefs::kLanguagePreferredLanguages) { 521 if (!pref_name || *pref_name == prefs::kLanguagePreferredLanguages) {
522 // Unlike kLanguagePreloadEngines and some other input method 522 // Unlike kLanguagePreloadEngines and some other input method
523 // preferencs, we don't need to send this to ibus-daemon. 523 // preferencs, we don't need to send this to ibus-daemon.
524 } 524 }
525 525
526 if (!pref_name || *pref_name == prefs::kLanguageXkbAutoRepeatEnabled) { 526 if (!pref_name || *pref_name == prefs::kLanguageXkbAutoRepeatEnabled) {
527 const bool enabled = xkb_auto_repeat_enabled_.GetValue(); 527 const bool enabled = xkb_auto_repeat_enabled_.GetValue();
528 input_method::XKeyboard::SetAutoRepeatEnabled(enabled); 528 input_method::GetInputMethodManager()->GetXKeyboard()->
529 SetAutoRepeatEnabled(enabled);
529 } 530 }
530 if (!pref_name || ((*pref_name == prefs::kLanguageXkbAutoRepeatDelay) || 531 if (!pref_name || ((*pref_name == prefs::kLanguageXkbAutoRepeatDelay) ||
531 (*pref_name == prefs::kLanguageXkbAutoRepeatInterval))) { 532 (*pref_name == prefs::kLanguageXkbAutoRepeatInterval))) {
532 UpdateAutoRepeatRate(); 533 UpdateAutoRepeatRate();
533 } 534 }
534 535
535 if (!pref_name) { 536 if (!pref_name) {
536 SetInputMethodList(); 537 SetInputMethodList();
537 } else if (*pref_name == prefs::kLanguagePreloadEngines) { 538 } else if (*pref_name == prefs::kLanguagePreloadEngines) {
538 SetLanguageConfigStringListAsCSV(language_prefs::kGeneralSectionName, 539 SetLanguageConfigStringListAsCSV(language_prefs::kGeneralSectionName,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 void Preferences::UpdateAutoRepeatRate() { 764 void Preferences::UpdateAutoRepeatRate() {
764 // Avoid setting repeat rate on desktop dev environment. 765 // Avoid setting repeat rate on desktop dev environment.
765 if (!base::chromeos::IsRunningOnChromeOS()) 766 if (!base::chromeos::IsRunningOnChromeOS())
766 return; 767 return;
767 768
768 input_method::AutoRepeatRate rate; 769 input_method::AutoRepeatRate rate;
769 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); 770 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue();
770 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); 771 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue();
771 DCHECK(rate.initial_delay_in_ms > 0); 772 DCHECK(rate.initial_delay_in_ms > 0);
772 DCHECK(rate.repeat_interval_in_ms > 0); 773 DCHECK(rate.repeat_interval_in_ms > 0);
773 input_method::XKeyboard::SetAutoRepeatRate(rate); 774 input_method::GetInputMethodManager()->GetXKeyboard()->
775 SetAutoRepeatRate(rate);
774 } 776 }
775 777
776 } // namespace chromeos 778 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698