| 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() {
|
|
|