| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 54 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 55 #include "chrome/browser/net/proxy_service_factory.h" | 55 #include "chrome/browser/net/proxy_service_factory.h" |
| 56 #include "chrome/browser/net/ssl_config_service_manager.h" | 56 #include "chrome/browser/net/ssl_config_service_manager.h" |
| 57 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 57 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 58 #include "chrome/browser/plugins/plugin_prefs.h" | 58 #include "chrome/browser/plugins/plugin_prefs.h" |
| 59 #include "chrome/browser/policy/profile_policy_connector.h" | 59 #include "chrome/browser/policy/profile_policy_connector.h" |
| 60 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 60 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 61 #include "chrome/browser/prefs/browser_prefs.h" | 61 #include "chrome/browser/prefs/browser_prefs.h" |
| 62 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 62 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| 63 #include "chrome/browser/prefs/pref_service_syncable.h" | 63 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 64 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" |
| 64 #include "chrome/browser/prerender/prerender_manager_factory.h" | 65 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 65 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" | 66 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" |
| 66 #include "chrome/browser/profiles/chrome_version_service.h" | 67 #include "chrome/browser/profiles/chrome_version_service.h" |
| 67 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" | 68 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" |
| 68 #include "chrome/browser/profiles/profile_destroyer.h" | 69 #include "chrome/browser/profiles/profile_destroyer.h" |
| 69 #include "chrome/browser/profiles/profile_info_cache.h" | 70 #include "chrome/browser/profiles/profile_info_cache.h" |
| 70 #include "chrome/browser/profiles/profile_manager.h" | 71 #include "chrome/browser/profiles/profile_manager.h" |
| 71 #include "chrome/browser/profiles/profile_metrics.h" | 72 #include "chrome/browser/profiles/profile_metrics.h" |
| 72 #include "chrome/browser/search_engines/template_url_fetcher.h" | 73 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 73 #include "chrome/browser/sessions/session_service_factory.h" | 74 #include "chrome/browser/sessions/session_service_factory.h" |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 RegisterProfilePrefsForServices(this, pref_registry_.get()); | 458 RegisterProfilePrefsForServices(this, pref_registry_.get()); |
| 458 | 459 |
| 459 ManagedUserSettingsService* managed_user_settings = NULL; | 460 ManagedUserSettingsService* managed_user_settings = NULL; |
| 460 #if defined(ENABLE_MANAGED_USERS) | 461 #if defined(ENABLE_MANAGED_USERS) |
| 461 managed_user_settings = | 462 managed_user_settings = |
| 462 ManagedUserSettingsServiceFactory::GetForProfile(this); | 463 ManagedUserSettingsServiceFactory::GetForProfile(this); |
| 463 managed_user_settings->Init( | 464 managed_user_settings->Init( |
| 464 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); | 465 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); |
| 465 #endif | 466 #endif |
| 466 | 467 |
| 468 // TODO(grt): construct pref_validation_delegate_. |
| 467 { | 469 { |
| 468 // On startup, preference loading is always synchronous so a scoped timer | 470 // On startup, preference loading is always synchronous so a scoped timer |
| 469 // will work here. | 471 // will work here. |
| 470 startup_metric_utils::ScopedSlowStartupUMA | 472 startup_metric_utils::ScopedSlowStartupUMA |
| 471 scoped_timer("Startup.SlowStartupPreferenceLoading"); | 473 scoped_timer("Startup.SlowStartupPreferenceLoading"); |
| 472 prefs_ = chrome_prefs::CreateProfilePrefs( | 474 prefs_ = chrome_prefs::CreateProfilePrefs( |
| 473 path_, | 475 path_, |
| 474 sequenced_task_runner, | 476 sequenced_task_runner, |
| 477 pref_validation_delegate_.get(), |
| 475 profile_policy_connector_->policy_service(), | 478 profile_policy_connector_->policy_service(), |
| 476 managed_user_settings, | 479 managed_user_settings, |
| 477 new ExtensionPrefStore( | 480 new ExtensionPrefStore( |
| 478 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false), | 481 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false), |
| 479 pref_registry_, | 482 pref_registry_, |
| 480 async_prefs).Pass(); | 483 async_prefs).Pass(); |
| 481 // Register on BrowserContext. | 484 // Register on BrowserContext. |
| 482 user_prefs::UserPrefs::Set(this, prefs_.get()); | 485 user_prefs::UserPrefs::Set(this, prefs_.get()); |
| 483 } | 486 } |
| 484 | 487 |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1360 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
| 1358 #if defined(OS_CHROMEOS) | 1361 #if defined(OS_CHROMEOS) |
| 1359 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1362 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 1360 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1363 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 1361 g_browser_process->local_state()); | 1364 g_browser_process->local_state()); |
| 1362 } | 1365 } |
| 1363 #endif // defined(OS_CHROMEOS) | 1366 #endif // defined(OS_CHROMEOS) |
| 1364 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1367 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 1365 GetPrefs(), g_browser_process->local_state()); | 1368 GetPrefs(), g_browser_process->local_state()); |
| 1366 } | 1369 } |
| OLD | NEW |