| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 const GaiaAuthConsumer::ClientLoginResult& credentials) { | 349 const GaiaAuthConsumer::ClientLoginResult& credentials) { |
| 350 TokenService* token_service = profile->GetTokenService(); | 350 TokenService* token_service = profile->GetTokenService(); |
| 351 token_service->UpdateCredentials(credentials); | 351 token_service->UpdateCredentials(credentials); |
| 352 if (token_service->AreCredentialsValid()) { | 352 if (token_service->AreCredentialsValid()) { |
| 353 token_service->StartFetchingTokens(); | 353 token_service->StartFetchingTokens(); |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 | 356 |
| 357 void LoginUtilsImpl::RespectLocalePreference(PrefService* prefs) { | 357 void LoginUtilsImpl::RespectLocalePreference(PrefService* prefs) { |
| 358 DCHECK(prefs != NULL); | 358 DCHECK(prefs != NULL); |
| 359 std::string pref_locale_override = | |
| 360 prefs->GetString(prefs::kApplicationLocaleOverride); | |
| 361 if (!pref_locale_override.empty()) { | |
| 362 LanguageSwitchMenu::SwitchLanguage(pref_locale_override); | |
| 363 return; | |
| 364 } | |
| 365 | |
| 366 if (g_browser_process == NULL) | 359 if (g_browser_process == NULL) |
| 367 return; | 360 return; |
| 368 std::string cur_locale = g_browser_process->GetApplicationLocale(); | 361 std::string cur_locale = g_browser_process->GetApplicationLocale(); |
| 369 | 362 |
| 370 std::string pref_locale = prefs->GetString(prefs::kApplicationLocale); | 363 std::string pref_locale = prefs->GetString(prefs::kApplicationLocale); |
| 371 if (!pref_locale.empty()) { | 364 if (!pref_locale.empty()) { |
| 372 if (prefs->GetString(prefs::kApplicationLocaleAccepted) == pref_locale) { | 365 if (prefs->GetString(prefs::kApplicationLocaleAccepted) == pref_locale) { |
| 373 // If locale is accepted then we do not want to show LocaleChange | 366 // If locale is accepted then we do not want to show LocaleChange |
| 374 // notification. This notification is triggered by different values of | 367 // notification. This notification is triggered by different values of |
| 375 // kApplicationLocaleBackup and kApplicationLocale preferences, | 368 // kApplicationLocaleBackup and kApplicationLocale preferences, |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 BrowserInit browser_init; | 579 BrowserInit browser_init; |
| 587 int return_code; | 580 int return_code; |
| 588 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 581 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
| 589 profile, | 582 profile, |
| 590 FilePath(), | 583 FilePath(), |
| 591 true, | 584 true, |
| 592 &return_code); | 585 &return_code); |
| 593 } | 586 } |
| 594 | 587 |
| 595 } // namespace chromeos | 588 } // namespace chromeos |
| OLD | NEW |