Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index 535d3c8b1ba9e1e34eeb39f22656772534efefec..e121070f46adb39087a857c2628fb7010270b754 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -845,15 +845,7 @@ ExtensionSpecialStoragePolicy* |
#endif |
} |
-void ProfileImpl::OnPrefsLoaded(bool success) { |
- TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded"); |
- SCOPED_UMA_HISTOGRAM_TIMER("Profile.OnPrefsLoadedTime"); |
- if (!success) { |
- if (delegate_) |
- delegate_->OnProfileCreated(this, false, false); |
- return; |
- } |
- |
+void ProfileImpl::OnLanguageSwitched() { |
// Migrate obsolete prefs. |
if (g_browser_process->local_state()) |
chrome::MigrateObsoleteBrowserPrefs(this, g_browser_process->local_state()); |
@@ -901,6 +893,28 @@ void ProfileImpl::OnPrefsLoaded(bool success) { |
DoFinalInit(); |
} |
+void ProfileImpl::SwitchUILanguage() { |
+#if defined(OS_CHROMEOS) |
+ chromeos::UserSessionManager::GetInstance()->RespectLocalePreferenceWrapper( |
+ this, |
+ base::Bind(&ProfileImpl::OnLanguageSwitched, base::Unretained(this))); |
+#else |
+ OnLanguageSwitched(); |
+#endif |
+} |
+ |
+void ProfileImpl::OnPrefsLoaded(bool success) { |
+ TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded"); |
Nikita (slow)
2015/04/02 17:37:05
As discussed, move trace event and histogram to On
Alexander Alekseev
2015/04/02 18:47:27
Let's move only histogram, as trace event should b
|
+ SCOPED_UMA_HISTOGRAM_TIMER("Profile.OnPrefsLoadedTime"); |
+ if (!success) { |
+ if (delegate_) |
+ delegate_->OnProfileCreated(this, false, false); |
+ return; |
+ } |
+ |
+ SwitchUILanguage(); |
+} |
+ |
bool ProfileImpl::WasCreatedByVersionOrLater(const std::string& version) { |
Version profile_version(ChromeVersionService::GetVersion(prefs_.get())); |
Version arg_version(version); |