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

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: Update after review. Created 5 years, 8 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
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..0f1861d0ec75155b24a0df5d5dee23c6489428f7 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -464,6 +464,10 @@ ProfileImpl::ProfileImpl(
policy::ProfilePolicyConnectorFactory::CreateForBrowserContext(
this, force_immediate_policy_load);
+#if defined(OS_CHROMEOS)
+ chromeos::UserSessionManager::GetInstance()->OnNewProfileCreating(this);
+#endif
+
DCHECK(create_mode == CREATE_MODE_ASYNCHRONOUS ||
create_mode == CREATE_MODE_SYNCHRONOUS);
bool async_prefs = create_mode == CREATE_MODE_ASYNCHRONOUS;
@@ -845,15 +849,8 @@ ExtensionSpecialStoragePolicy*
#endif
}
-void ProfileImpl::OnPrefsLoaded(bool success) {
- TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded");
+void ProfileImpl::OnPrefsLoadedImpl() {
SCOPED_UMA_HISTOGRAM_TIMER("Profile.OnPrefsLoadedTime");
- if (!success) {
- if (delegate_)
- delegate_->OnProfileCreated(this, false, false);
- return;
- }
-
// Migrate obsolete prefs.
if (g_browser_process->local_state())
chrome::MigrateObsoleteBrowserPrefs(this, g_browser_process->local_state());
@@ -901,6 +898,24 @@ void ProfileImpl::OnPrefsLoaded(bool success) {
DoFinalInit();
}
+void ProfileImpl::OnPrefsLoaded(bool success) {
+ TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded");
+ if (!success) {
+ if (delegate_)
+ delegate_->OnProfileCreated(this, false, false);
+ return;
+ }
+
+#if defined(OS_CHROMEOS)
+ if (!on_prefs_loaded_hook_.is_null()) {
+ on_prefs_loaded_hook_.Run(this, base::Bind(&ProfileImpl::OnPrefsLoadedImpl,
+ base::Unretained(this)));
+ return;
+ }
+#endif
+ OnPrefsLoadedImpl();
+}
+
bool ProfileImpl::WasCreatedByVersionOrLater(const std::string& version) {
Version profile_version(ChromeVersionService::GetVersion(prefs_.get()));
Version arg_version(version);
@@ -1205,6 +1220,10 @@ void ProfileImpl::InitChromeOSPreferences() {
this, chromeos::ProfileHelper::Get()->GetUserByProfile(this));
}
+void ProfileImpl::SetOnPrefsLoadedHook(
+ const base::Callback<void(Profile*, const base::Closure&)>& callback) {
+ on_prefs_loaded_hook_ = callback;
+}
#endif // defined(OS_CHROMEOS)
PrefProxyConfigTracker* ProfileImpl::GetProxyConfigTracker() {
« chrome/browser/profiles/profile.h ('K') | « chrome/browser/profiles/profile_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698