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

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

Issue 9999018: chrome/browser/chromeos/input_method/ refactoring [part 6 of 6] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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/login/screen_locker.cc ('k') | chrome/browser/chromeos/preferences_unittest.cc » ('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 cc4828f4cf436b0d98f25b4b3bb3537f47c85f65..4574db4f24e5efad6905c70c7610a6b4e8c417ad 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -623,6 +623,12 @@ void Preferences::SetLanguageConfigStringListAsCSV(const char* section,
if (!value.empty())
base::SplitString(value, ',', &split_values);
+ if (section == std::string(language_prefs::kGeneralSectionName) &&
+ name == std::string(language_prefs::kPreloadEnginesConfigName)) {
+ input_method_manager_->EnableInputMethods(split_values);
+ return;
+ }
+
// We should call the cros API even when |value| is empty, to disable default
// config.
SetLanguageConfigStringList(section, name, split_values);
@@ -694,15 +700,13 @@ void Preferences::UpdateAutoRepeatRate() {
input_method::XKeyboard::SetAutoRepeatRate(rate);
}
+// static
void Preferences::UpdateVirturalKeyboardPreference(PrefService* prefs) {
const DictionaryValue* virtual_keyboard_pref =
prefs->GetDictionary(prefs::kLanguagePreferredVirtualKeyboard);
DCHECK(virtual_keyboard_pref);
- input_method::InputMethodManager* input_method_manager =
- input_method::InputMethodManager::GetInstance();
- input_method_manager->ClearAllVirtualKeyboardPreferences();
-
+ // TODO(yusukes): Clear all virtual keyboard preferences here.
std::string url;
std::vector<std::string> layouts_to_remove;
for (DictionaryValue::key_iterator iter = virtual_keyboard_pref->begin_keys();
@@ -711,14 +715,7 @@ void Preferences::UpdateVirturalKeyboardPreference(PrefService* prefs) {
const std::string& layout_id = *iter; // e.g. "us", "handwriting-vk"
if (!virtual_keyboard_pref->GetString(layout_id, &url))
continue;
- if (!input_method_manager->SetVirtualKeyboardPreference(
- layout_id, GURL(url))) {
- // Either |layout_id| or |url| is invalid. Remove the key from |prefs|
- // later.
- layouts_to_remove.push_back(layout_id);
- LOG(ERROR) << "Removing invalid virtual keyboard pref: layout="
- << layout_id;
- }
+ // TODO(yusukes): add the virtual keyboard preferences here.
}
// Remove invalid prefs.
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker.cc ('k') | chrome/browser/chromeos/preferences_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698