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

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

Issue 3010053: Add both English and the alternate language to the preferred language list on first login. (Closed)
Patch Set: Code Review Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698