| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 130 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| 131 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | 131 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
| 132 #endif | 132 #endif |
| 133 #endif | 133 #endif |
| 134 | 134 |
| 135 #if defined(ENABLE_EXTENSIONS) | 135 #if defined(ENABLE_EXTENSIONS) |
| 136 #include "chrome/browser/guest_view/guest_view_manager.h" | 136 #include "chrome/browser/guest_view/guest_view_manager.h" |
| 137 #endif | 137 #endif |
| 138 | 138 |
| 139 #if defined(ENABLE_MANAGED_USERS) | 139 #if defined(ENABLE_MANAGED_USERS) |
| 140 #include "chrome/browser/managed_mode/managed_user_settings_service.h" | 140 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" |
| 141 #include "chrome/browser/managed_mode/managed_user_settings_service_factory.h" | 141 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor
y.h" |
| 142 #endif | 142 #endif |
| 143 | 143 |
| 144 using base::Time; | 144 using base::Time; |
| 145 using base::TimeDelta; | 145 using base::TimeDelta; |
| 146 using base::UserMetricsAction; | 146 using base::UserMetricsAction; |
| 147 using content::BrowserThread; | 147 using content::BrowserThread; |
| 148 using content::DownloadManagerDelegate; | 148 using content::DownloadManagerDelegate; |
| 149 using content::HostZoomMap; | 149 using content::HostZoomMap; |
| 150 | 150 |
| 151 namespace { | 151 namespace { |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 #if defined(OS_CHROMEOS) | 451 #if defined(OS_CHROMEOS) |
| 452 if (chromeos::ProfileHelper::IsSigninProfile(this)) | 452 if (chromeos::ProfileHelper::IsSigninProfile(this)) |
| 453 chrome::RegisterLoginProfilePrefs(pref_registry_.get()); | 453 chrome::RegisterLoginProfilePrefs(pref_registry_.get()); |
| 454 else | 454 else |
| 455 #endif | 455 #endif |
| 456 chrome::RegisterUserProfilePrefs(pref_registry_.get()); | 456 chrome::RegisterUserProfilePrefs(pref_registry_.get()); |
| 457 | 457 |
| 458 BrowserContextDependencyManager::GetInstance()-> | 458 BrowserContextDependencyManager::GetInstance()-> |
| 459 RegisterProfilePrefsForServices(this, pref_registry_.get()); | 459 RegisterProfilePrefsForServices(this, pref_registry_.get()); |
| 460 | 460 |
| 461 ManagedUserSettingsService* managed_user_settings = NULL; | 461 SupervisedUserSettingsService* supervised_user_settings = NULL; |
| 462 #if defined(ENABLE_MANAGED_USERS) | 462 #if defined(ENABLE_MANAGED_USERS) |
| 463 managed_user_settings = | 463 supervised_user_settings = |
| 464 ManagedUserSettingsServiceFactory::GetForProfile(this); | 464 SupervisedUserSettingsServiceFactory::GetForProfile(this); |
| 465 managed_user_settings->Init( | 465 supervised_user_settings->Init( |
| 466 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); | 466 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); |
| 467 #endif | 467 #endif |
| 468 | 468 |
| 469 scoped_refptr<SafeBrowsingService> safe_browsing_service( | 469 scoped_refptr<SafeBrowsingService> safe_browsing_service( |
| 470 g_browser_process->safe_browsing_service()); | 470 g_browser_process->safe_browsing_service()); |
| 471 if (safe_browsing_service) { | 471 if (safe_browsing_service) { |
| 472 pref_validation_delegate_ = | 472 pref_validation_delegate_ = |
| 473 safe_browsing_service->CreatePreferenceValidationDelegate().Pass(); | 473 safe_browsing_service->CreatePreferenceValidationDelegate().Pass(); |
| 474 } | 474 } |
| 475 | 475 |
| 476 { | 476 { |
| 477 // On startup, preference loading is always synchronous so a scoped timer | 477 // On startup, preference loading is always synchronous so a scoped timer |
| 478 // will work here. | 478 // will work here. |
| 479 startup_metric_utils::ScopedSlowStartupUMA | 479 startup_metric_utils::ScopedSlowStartupUMA |
| 480 scoped_timer("Startup.SlowStartupPreferenceLoading"); | 480 scoped_timer("Startup.SlowStartupPreferenceLoading"); |
| 481 prefs_ = chrome_prefs::CreateProfilePrefs( | 481 prefs_ = chrome_prefs::CreateProfilePrefs( |
| 482 path_, | 482 path_, |
| 483 sequenced_task_runner, | 483 sequenced_task_runner, |
| 484 pref_validation_delegate_.get(), | 484 pref_validation_delegate_.get(), |
| 485 profile_policy_connector_->policy_service(), | 485 profile_policy_connector_->policy_service(), |
| 486 managed_user_settings, | 486 supervised_user_settings, |
| 487 new ExtensionPrefStore( | 487 new ExtensionPrefStore( |
| 488 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false), | 488 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false), |
| 489 pref_registry_, | 489 pref_registry_, |
| 490 async_prefs).Pass(); | 490 async_prefs).Pass(); |
| 491 // Register on BrowserContext. | 491 // Register on BrowserContext. |
| 492 user_prefs::UserPrefs::Set(this, prefs_.get()); | 492 user_prefs::UserPrefs::Set(this, prefs_.get()); |
| 493 } | 493 } |
| 494 | 494 |
| 495 startup_metric_utils::ScopedSlowStartupUMA | 495 startup_metric_utils::ScopedSlowStartupUMA |
| 496 scoped_timer("Startup.SlowStartupFinalProfileInit"); | 496 scoped_timer("Startup.SlowStartupFinalProfileInit"); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1322 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
| 1323 #if defined(OS_CHROMEOS) | 1323 #if defined(OS_CHROMEOS) |
| 1324 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1324 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 1325 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1325 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 1326 g_browser_process->local_state()); | 1326 g_browser_process->local_state()); |
| 1327 } | 1327 } |
| 1328 #endif // defined(OS_CHROMEOS) | 1328 #endif // defined(OS_CHROMEOS) |
| 1329 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1329 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 1330 GetPrefs(), g_browser_process->local_state()); | 1330 GetPrefs(), g_browser_process->local_state()); |
| 1331 } | 1331 } |
| OLD | NEW |