Chromium Code Reviews| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 #include "chrome/browser/profiles/profile_metrics.h" | 68 #include "chrome/browser/profiles/profile_metrics.h" |
| 69 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" | 69 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" |
| 70 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" | 70 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
| 71 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 71 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 72 #include "chrome/browser/sessions/session_service_factory.h" | 72 #include "chrome/browser/sessions/session_service_factory.h" |
| 73 #include "chrome/browser/signin/signin_manager_factory.h" | 73 #include "chrome/browser/signin/signin_manager_factory.h" |
| 74 #include "chrome/browser/signin/signin_ui_util.h" | 74 #include "chrome/browser/signin/signin_ui_util.h" |
| 75 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 75 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
| 76 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 76 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
| 77 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 77 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 78 #include "chrome/browser/ui/webui/prefs_internals_source.h" | |
| 78 #include "chrome/common/chrome_constants.h" | 79 #include "chrome/common/chrome_constants.h" |
| 79 #include "chrome/common/chrome_paths.h" | 80 #include "chrome/common/chrome_paths.h" |
| 80 #include "chrome/common/chrome_paths_internal.h" | 81 #include "chrome/common/chrome_paths_internal.h" |
| 81 #include "chrome/common/chrome_switches.h" | 82 #include "chrome/common/chrome_switches.h" |
| 82 #include "chrome/common/features.h" | 83 #include "chrome/common/features.h" |
| 83 #include "chrome/common/pref_names.h" | 84 #include "chrome/common/pref_names.h" |
| 84 #include "chrome/common/url_constants.h" | 85 #include "chrome/common/url_constants.h" |
| 85 #include "chrome/grit/chromium_strings.h" | 86 #include "chrome/grit/chromium_strings.h" |
| 86 #include "components/bookmarks/browser/bookmark_model.h" | 87 #include "components/bookmarks/browser/bookmark_model.h" |
| 87 #include "components/content_settings/core/browser/cookie_settings.h" | 88 #include "components/content_settings/core/browser/cookie_settings.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 500 // Wait for the notification that prefs has been loaded | 501 // Wait for the notification that prefs has been loaded |
| 501 // (successfully or not). Note that we can use base::Unretained | 502 // (successfully or not). Note that we can use base::Unretained |
| 502 // because the PrefService is owned by this class and lives on | 503 // because the PrefService is owned by this class and lives on |
| 503 // the same thread. | 504 // the same thread. |
| 504 prefs_->AddPrefInitObserver(base::Bind( | 505 prefs_->AddPrefInitObserver(base::Bind( |
| 505 &ProfileImpl::OnPrefsLoaded, base::Unretained(this), create_mode)); | 506 &ProfileImpl::OnPrefsLoaded, base::Unretained(this), create_mode)); |
| 506 } else { | 507 } else { |
| 507 // Prefs were loaded synchronously so we can continue directly. | 508 // Prefs were loaded synchronously so we can continue directly. |
| 508 OnPrefsLoaded(create_mode, true); | 509 OnPrefsLoaded(create_mode, true); |
| 509 } | 510 } |
| 511 | |
| 512 content::URLDataSource::Add(this, new PrefsInternalsSource(this)); | |
|
Devlin
2017/03/01 17:59:23
Any better place for this?
Dan Beam
2017/03/08 18:40:58
i don't really know but in an ideal world this wou
Devlin
2017/03/09 01:21:49
Agreed - does the webui framework offer a way to d
Dan Beam
2017/03/09 02:16:54
not really
| |
| 510 } | 513 } |
| 511 | 514 |
| 512 void ProfileImpl::DoFinalInit() { | 515 void ProfileImpl::DoFinalInit() { |
| 513 TRACE_EVENT0("browser", "ProfileImpl::DoFinalInit") | 516 TRACE_EVENT0("browser", "ProfileImpl::DoFinalInit") |
| 514 SCOPED_UMA_HISTOGRAM_TIMER("Profile.ProfileImplDoFinalInit"); | 517 SCOPED_UMA_HISTOGRAM_TIMER("Profile.ProfileImplDoFinalInit"); |
| 515 | 518 |
| 516 PrefService* prefs = GetPrefs(); | 519 PrefService* prefs = GetPrefs(); |
| 517 pref_change_registrar_.Init(prefs); | 520 pref_change_registrar_.Init(prefs); |
| 518 pref_change_registrar_.Add( | 521 pref_change_registrar_.Add( |
| 519 prefs::kSupervisedUserId, | 522 prefs::kSupervisedUserId, |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1292 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1295 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
| 1293 domain_reliability::DomainReliabilityService* service = | 1296 domain_reliability::DomainReliabilityService* service = |
| 1294 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1297 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
| 1295 GetForBrowserContext(this); | 1298 GetForBrowserContext(this); |
| 1296 if (!service) | 1299 if (!service) |
| 1297 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1300 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); |
| 1298 | 1301 |
| 1299 return service->CreateMonitor( | 1302 return service->CreateMonitor( |
| 1300 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 1303 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 1301 } | 1304 } |
| OLD | NEW |