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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 37 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
38 #include "chrome/browser/browser_process.h" | 38 #include "chrome/browser/browser_process.h" |
39 #include "chrome/browser/chrome_notification_types.h" | 39 #include "chrome/browser/chrome_notification_types.h" |
40 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 40 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
41 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 41 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
42 #include "chrome/browser/dom_distiller/profile_utils.h" | 42 #include "chrome/browser/dom_distiller/profile_utils.h" |
43 #include "chrome/browser/domain_reliability/service_factory.h" | 43 #include "chrome/browser/domain_reliability/service_factory.h" |
44 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 44 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
45 #include "chrome/browser/download/download_service.h" | 45 #include "chrome/browser/download/download_service.h" |
46 #include "chrome/browser/download/download_service_factory.h" | 46 #include "chrome/browser/download/download_service_factory.h" |
47 #include "chrome/browser/net/net_pref_observer.h" | |
48 #include "chrome/browser/net/predictor.h" | 47 #include "chrome/browser/net/predictor.h" |
49 #include "chrome/browser/net/proxy_service_factory.h" | 48 #include "chrome/browser/net/proxy_service_factory.h" |
50 #include "chrome/browser/permissions/permission_manager.h" | 49 #include "chrome/browser/permissions/permission_manager.h" |
51 #include "chrome/browser/permissions/permission_manager_factory.h" | 50 #include "chrome/browser/permissions/permission_manager_factory.h" |
52 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 51 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
53 #include "chrome/browser/plugins/plugin_prefs.h" | 52 #include "chrome/browser/plugins/plugin_prefs.h" |
54 #include "chrome/browser/policy/profile_policy_connector.h" | 53 #include "chrome/browser/policy/profile_policy_connector.h" |
55 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 54 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
56 #include "chrome/browser/policy/schema_registry_service.h" | 55 #include "chrome/browser/policy/schema_registry_service.h" |
57 #include "chrome/browser/policy/schema_registry_service_factory.h" | 56 #include "chrome/browser/policy/schema_registry_service_factory.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 prefs_->SetBoolean(prefs::kSessionExitedCleanly, true); | 839 prefs_->SetBoolean(prefs::kSessionExitedCleanly, true); |
841 | 840 |
842 g_browser_process->profile_manager()->InitProfileUserPrefs(this); | 841 g_browser_process->profile_manager()->InitProfileUserPrefs(this); |
843 | 842 |
844 { | 843 { |
845 SCOPED_UMA_HISTOGRAM_TIMER("Profile.CreateBrowserContextServicesTime"); | 844 SCOPED_UMA_HISTOGRAM_TIMER("Profile.CreateBrowserContextServicesTime"); |
846 BrowserContextDependencyManager::GetInstance()-> | 845 BrowserContextDependencyManager::GetInstance()-> |
847 CreateBrowserContextServices(this); | 846 CreateBrowserContextServices(this); |
848 } | 847 } |
849 | 848 |
850 DCHECK(!net_pref_observer_); | |
851 { | |
852 TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded:NetPrefObserver") | |
853 net_pref_observer_.reset(new NetPrefObserver(prefs_.get())); | |
854 } | |
855 | |
856 ChromeVersionService::OnProfileLoaded(prefs_.get(), IsNewProfile()); | 849 ChromeVersionService::OnProfileLoaded(prefs_.get(), IsNewProfile()); |
857 DoFinalInit(); | 850 DoFinalInit(); |
858 } | 851 } |
859 | 852 |
860 void ProfileImpl::OnPrefsLoaded(CreateMode create_mode, bool success) { | 853 void ProfileImpl::OnPrefsLoaded(CreateMode create_mode, bool success) { |
861 TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded"); | 854 TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded"); |
862 if (!success) { | 855 if (!success) { |
863 if (delegate_) | 856 if (delegate_) |
864 delegate_->OnProfileCreated(this, false, false); | 857 delegate_->OnProfileCreated(this, false, false); |
865 return; | 858 return; |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1273 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1281 domain_reliability::DomainReliabilityService* service = | 1274 domain_reliability::DomainReliabilityService* service = |
1282 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1275 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1283 GetForBrowserContext(this); | 1276 GetForBrowserContext(this); |
1284 if (!service) | 1277 if (!service) |
1285 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1278 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1286 | 1279 |
1287 return service->CreateMonitor( | 1280 return service->CreateMonitor( |
1288 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 1281 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
1289 } | 1282 } |
OLD | NEW |