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

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: Fix build failure. 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 void Preferences::UpdateAutoRepeatRate() { 781 void Preferences::UpdateAutoRepeatRate() {
781 // Avoid setting repeat rate on desktop dev environment. 782 // Avoid setting repeat rate on desktop dev environment.
782 if (!base::chromeos::IsRunningOnChromeOS()) 783 if (!base::chromeos::IsRunningOnChromeOS())
783 return; 784 return;
784 785
785 input_method::AutoRepeatRate rate; 786 input_method::AutoRepeatRate rate;
786 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); 787 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue();
787 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); 788 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue();
788 DCHECK(rate.initial_delay_in_ms > 0); 789 DCHECK(rate.initial_delay_in_ms > 0);
789 DCHECK(rate.repeat_interval_in_ms > 0); 790 DCHECK(rate.repeat_interval_in_ms > 0);
790 input_method::XKeyboard::SetAutoRepeatRate(rate); 791 input_method::GetInputMethodManager()->GetXKeyboard()->
792 SetAutoRepeatRate(rate);
791 } 793 }
792 794
793 } // namespace chromeos 795 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/input_method/xkeyboard_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698