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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 1055863002: ChromeOS: switch UI language before apps are loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698