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

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 312023002: Sync starting language and input method preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/login/session/user_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 for (size_t i = 0; i < candidates.size(); ++i) { 165 for (size_t i = 0; i < candidates.size(); ++i) {
166 const std::string& candidate = candidates[i]; 166 const std::string& candidate = candidates[i];
167 // Skip if it's already in language_codes. 167 // Skip if it's already in language_codes.
168 if (std::count(language_codes.begin(), language_codes.end(), 168 if (std::count(language_codes.begin(), language_codes.end(),
169 candidate) == 0) { 169 candidate) == 0) {
170 language_codes.push_back(candidate); 170 language_codes.push_back(candidate);
171 } 171 }
172 } 172 }
173 173
174 // Save the preferred languages in the user's preferences. 174 // Save the preferred languages in the user's preferences.
175 StringPrefMember language_preferred_languages; 175 prefs->SetString(prefs::kLanguagePreferredLanguages,
176 language_preferred_languages.Init(prefs::kLanguagePreferredLanguages, prefs); 176 JoinString(language_codes, ','));
177 language_preferred_languages.SetValue(JoinString(language_codes, ',')); 177
178 // Indicate that we need to merge the syncable input methods when we sync,
179 // since we have not applied the synced prefs before.
180 prefs->SetBoolean(prefs::kLanguageShouldMergeInputMethods, true);
178 } 181 }
179 182
180 #if defined(ENABLE_RLZ) 183 #if defined(ENABLE_RLZ)
181 // Flag file that disables RLZ tracking, when present. 184 // Flag file that disables RLZ tracking, when present.
182 const base::FilePath::CharType kRLZDisabledFlagName[] = 185 const base::FilePath::CharType kRLZDisabledFlagName[] =
183 FILE_PATH_LITERAL(".rlz_disabled"); 186 FILE_PATH_LITERAL(".rlz_disabled");
184 187
185 base::FilePath GetRlzDisabledFlagPath() { 188 base::FilePath GetRlzDisabledFlagPath() {
186 base::FilePath homedir; 189 base::FilePath homedir;
187 PathService::Get(base::DIR_HOME, &homedir); 190 PathService::Get(base::DIR_HOME, &homedir);
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 } 1480 }
1478 1481
1479 // static 1482 // static
1480 void UserSessionManager::RunCallbackOnLocaleLoaded( 1483 void UserSessionManager::RunCallbackOnLocaleLoaded(
1481 const base::Closure& callback, 1484 const base::Closure& callback,
1482 InputEventsBlocker* /* input_events_blocker */, 1485 InputEventsBlocker* /* input_events_blocker */,
1483 const locale_util::LanguageSwitchResult& /* result */) { 1486 const locale_util::LanguageSwitchResult& /* result */) {
1484 callback.Run(); 1487 callback.Run();
1485 } 1488 }
1486 1489
1490 void UserSessionManager::RemoveProfileForTesting(Profile* profile) {
1491 default_ime_states_.erase(profile);
1492 }
1493
1487 } // namespace chromeos 1494 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/session/user_session_manager.h ('k') | chrome/browser/chromeos/login/users/fake_user_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698