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

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: Refactored for xkb refactor Created 6 years, 2 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 | 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 for (size_t i = 0; i < candidates.size(); ++i) { 141 for (size_t i = 0; i < candidates.size(); ++i) {
142 const std::string& candidate = candidates[i]; 142 const std::string& candidate = candidates[i];
143 // Skip if it's already in language_codes. 143 // Skip if it's already in language_codes.
144 if (std::count(language_codes.begin(), language_codes.end(), 144 if (std::count(language_codes.begin(), language_codes.end(),
145 candidate) == 0) { 145 candidate) == 0) {
146 language_codes.push_back(candidate); 146 language_codes.push_back(candidate);
147 } 147 }
148 } 148 }
149 149
150 // Save the preferred languages in the user's preferences. 150 // Save the preferred languages in the user's preferences.
151 StringPrefMember language_preferred_languages; 151 prefs->SetString(prefs::kLanguagePreferredLanguages,
152 language_preferred_languages.Init(prefs::kLanguagePreferredLanguages, prefs); 152 JoinString(language_codes, ','));
153 language_preferred_languages.SetValue(JoinString(language_codes, ',')); 153
154 // Indicate that we need to merge the syncable input methods when we sync,
155 // since we have not applied the synced prefs before.
156 prefs->SetBoolean(prefs::kLanguageShouldMergeInputMethods, true);
154 } 157 }
155 158
156 #if defined(ENABLE_RLZ) 159 #if defined(ENABLE_RLZ)
157 // Flag file that disables RLZ tracking, when present. 160 // Flag file that disables RLZ tracking, when present.
158 const base::FilePath::CharType kRLZDisabledFlagName[] = 161 const base::FilePath::CharType kRLZDisabledFlagName[] =
159 FILE_PATH_LITERAL(".rlz_disabled"); 162 FILE_PATH_LITERAL(".rlz_disabled");
160 163
161 base::FilePath GetRlzDisabledFlagPath() { 164 base::FilePath GetRlzDisabledFlagPath() {
162 base::FilePath homedir; 165 base::FilePath homedir;
163 PathService::Get(base::DIR_HOME, &homedir); 166 PathService::Get(base::DIR_HOME, &homedir);
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 return state; 1150 return state;
1148 } 1151 }
1149 1152
1150 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() { 1153 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() {
1151 if (!easy_unlock_key_manager_) 1154 if (!easy_unlock_key_manager_)
1152 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager); 1155 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager);
1153 1156
1154 return easy_unlock_key_manager_.get(); 1157 return easy_unlock_key_manager_.get();
1155 } 1158 }
1156 1159
1160 void UserSessionManager::RemoveProfileForTesting(Profile* profile) {
1161 default_ime_states_.erase(profile);
1162 }
1163
1157 } // namespace chromeos 1164 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698