OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 locale, input_method::kAllInputMethods, &input_method_ids); | 157 locale, input_method::kAllInputMethods, &input_method_ids); |
158 if (!input_method_ids.empty()) { | 158 if (!input_method_ids.empty()) { |
159 if (!preload_engines.empty()) | 159 if (!preload_engines.empty()) |
160 preload_engines += ','; | 160 preload_engines += ','; |
161 preload_engines += JoinString(input_method_ids, ','); | 161 preload_engines += JoinString(input_method_ids, ','); |
162 } | 162 } |
163 language_preload_engines_.SetValue(preload_engines); | 163 language_preload_engines_.SetValue(preload_engines); |
164 } | 164 } |
165 // Add the UI language to the preferred languages the user first logs in. | 165 // Add the UI language to the preferred languages the user first logs in. |
166 if (!prefs->HasPrefPath(prefs::kLanguagePreferredLanguages)) { | 166 if (!prefs->HasPrefPath(prefs::kLanguagePreferredLanguages)) { |
167 language_preferred_languages_.SetValue(locale); | 167 std::string preferred_languages(locale); |
| 168 if (locale != kFallbackInputMethodLocale) { |
| 169 preferred_languages += ","; |
| 170 preferred_languages += kFallbackInputMethodLocale; |
| 171 } |
| 172 language_preferred_languages_.SetValue(preferred_languages); |
168 } | 173 } |
169 | 174 |
170 // Initialize touchpad settings to what's saved in user preferences. | 175 // Initialize touchpad settings to what's saved in user preferences. |
171 NotifyPrefChanged(NULL); | 176 NotifyPrefChanged(NULL); |
172 } | 177 } |
173 | 178 |
174 void Preferences::Observe(NotificationType type, | 179 void Preferences::Observe(NotificationType type, |
175 const NotificationSource& source, | 180 const NotificationSource& source, |
176 const NotificationDetails& details) { | 181 const NotificationDetails& details) { |
177 if (type == NotificationType::PREF_CHANGED) | 182 if (type == NotificationType::PREF_CHANGED) |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 std::vector<std::string> split_values; | 386 std::vector<std::string> split_values; |
382 if (!value.empty()) | 387 if (!value.empty()) |
383 SplitString(value, ',', &split_values); | 388 SplitString(value, ',', &split_values); |
384 | 389 |
385 // We should call the cros API even when |value| is empty, to disable default | 390 // We should call the cros API even when |value| is empty, to disable default |
386 // config. | 391 // config. |
387 SetLanguageConfigStringList(section, name, split_values); | 392 SetLanguageConfigStringList(section, name, split_values); |
388 } | 393 } |
389 | 394 |
390 } // namespace chromeos | 395 } // namespace chromeos |
OLD | NEW |