OLD | NEW |
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 Loading... |
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 prefs->SetString(prefs::kLanguagePreferredLanguages, | 175 StringPrefMember language_preferred_languages; |
176 JoinString(language_codes, ',')); | 176 language_preferred_languages.Init(prefs::kLanguagePreferredLanguages, prefs); |
177 | 177 language_preferred_languages.SetValue(JoinString(language_codes, ',')); |
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); | |
181 } | 178 } |
182 | 179 |
183 #if defined(ENABLE_RLZ) | 180 #if defined(ENABLE_RLZ) |
184 // Flag file that disables RLZ tracking, when present. | 181 // Flag file that disables RLZ tracking, when present. |
185 const base::FilePath::CharType kRLZDisabledFlagName[] = | 182 const base::FilePath::CharType kRLZDisabledFlagName[] = |
186 FILE_PATH_LITERAL(".rlz_disabled"); | 183 FILE_PATH_LITERAL(".rlz_disabled"); |
187 | 184 |
188 base::FilePath GetRlzDisabledFlagPath() { | 185 base::FilePath GetRlzDisabledFlagPath() { |
189 base::FilePath homedir; | 186 base::FilePath homedir; |
190 PathService::Get(base::DIR_HOME, &homedir); | 187 PathService::Get(base::DIR_HOME, &homedir); |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 } | 1478 } |
1482 | 1479 |
1483 // static | 1480 // static |
1484 void UserSessionManager::RunCallbackOnLocaleLoaded( | 1481 void UserSessionManager::RunCallbackOnLocaleLoaded( |
1485 const base::Closure& callback, | 1482 const base::Closure& callback, |
1486 InputEventsBlocker* /* input_events_blocker */, | 1483 InputEventsBlocker* /* input_events_blocker */, |
1487 const locale_util::LanguageSwitchResult& /* result */) { | 1484 const locale_util::LanguageSwitchResult& /* result */) { |
1488 callback.Run(); | 1485 callback.Run(); |
1489 } | 1486 } |
1490 | 1487 |
1491 void UserSessionManager::RemoveProfileForTesting(Profile* profile) { | |
1492 default_ime_states_.erase(profile); | |
1493 } | |
1494 | |
1495 } // namespace chromeos | 1488 } // namespace chromeos |
OLD | NEW |