| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 ManagedUserSettingsServiceFactory::GetForProfile(this); | 441 ManagedUserSettingsServiceFactory::GetForProfile(this); |
| 442 managed_user_settings->Init( | 442 managed_user_settings->Init( |
| 443 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); | 443 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); |
| 444 #endif | 444 #endif |
| 445 | 445 |
| 446 { | 446 { |
| 447 // On startup, preference loading is always synchronous so a scoped timer | 447 // On startup, preference loading is always synchronous so a scoped timer |
| 448 // will work here. | 448 // will work here. |
| 449 startup_metric_utils::ScopedSlowStartupUMA | 449 startup_metric_utils::ScopedSlowStartupUMA |
| 450 scoped_timer("Startup.SlowStartupPreferenceLoading"); | 450 scoped_timer("Startup.SlowStartupPreferenceLoading"); |
| 451 prefs_.reset(chrome_prefs::CreateProfilePrefs( | 451 prefs_ = chrome_prefs::CreateProfilePrefs( |
| 452 GetPrefFilePath(), | 452 GetPrefFilePath(), |
| 453 sequenced_task_runner, | 453 sequenced_task_runner, |
| 454 profile_policy_connector_->policy_service(), | 454 profile_policy_connector_->policy_service(), |
| 455 managed_user_settings, | 455 managed_user_settings, |
| 456 new ExtensionPrefStore( | 456 new ExtensionPrefStore( |
| 457 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false), | 457 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false), |
| 458 pref_registry_, | 458 pref_registry_, |
| 459 async_prefs)); | 459 async_prefs).Pass(); |
| 460 // Register on BrowserContext. | 460 // Register on BrowserContext. |
| 461 user_prefs::UserPrefs::Set(this, prefs_.get()); | 461 user_prefs::UserPrefs::Set(this, prefs_.get()); |
| 462 } | 462 } |
| 463 | 463 |
| 464 startup_metric_utils::ScopedSlowStartupUMA | 464 startup_metric_utils::ScopedSlowStartupUMA |
| 465 scoped_timer("Startup.SlowStartupFinalProfileInit"); | 465 scoped_timer("Startup.SlowStartupFinalProfileInit"); |
| 466 if (async_prefs) { | 466 if (async_prefs) { |
| 467 // Wait for the notification that prefs has been loaded | 467 // Wait for the notification that prefs has been loaded |
| 468 // (successfully or not). Note that we can use base::Unretained | 468 // (successfully or not). Note that we can use base::Unretained |
| 469 // because the PrefService is owned by this class and lives on | 469 // because the PrefService is owned by this class and lives on |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1242 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
| 1243 #if defined(OS_CHROMEOS) | 1243 #if defined(OS_CHROMEOS) |
| 1244 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1244 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 1245 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1245 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 1246 g_browser_process->local_state()); | 1246 g_browser_process->local_state()); |
| 1247 } | 1247 } |
| 1248 #endif // defined(OS_CHROMEOS) | 1248 #endif // defined(OS_CHROMEOS) |
| 1249 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1249 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 1250 GetPrefs(), g_browser_process->local_state()); | 1250 GetPrefs(), g_browser_process->local_state()); |
| 1251 } | 1251 } |
| OLD | NEW |