| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 #include "components/zoom/zoom_event_manager.h" | 108 #include "components/zoom/zoom_event_manager.h" |
| 109 #include "content/public/browser/browser_thread.h" | 109 #include "content/public/browser/browser_thread.h" |
| 110 #include "content/public/browser/dom_storage_context.h" | 110 #include "content/public/browser/dom_storage_context.h" |
| 111 #include "content/public/browser/notification_service.h" | 111 #include "content/public/browser/notification_service.h" |
| 112 #include "content/public/browser/render_process_host.h" | 112 #include "content/public/browser/render_process_host.h" |
| 113 #include "content/public/browser/storage_partition.h" | 113 #include "content/public/browser/storage_partition.h" |
| 114 #include "content/public/browser/url_data_source.h" | 114 #include "content/public/browser/url_data_source.h" |
| 115 #include "content/public/common/content_constants.h" | 115 #include "content/public/common/content_constants.h" |
| 116 #include "content/public/common/page_zoom.h" | 116 #include "content/public/common/page_zoom.h" |
| 117 #include "extensions/features/features.h" | 117 #include "extensions/features/features.h" |
| 118 #include "mojo/public/cpp/bindings/strong_binding.h" | |
| 119 #include "ppapi/features/features.h" | 118 #include "ppapi/features/features.h" |
| 120 #include "printing/features/features.h" | 119 #include "printing/features/features.h" |
| 121 #include "services/identity/identity_service.h" | 120 #include "services/identity/identity_service.h" |
| 122 #include "services/identity/public/interfaces/constants.mojom.h" | 121 #include "services/identity/public/interfaces/constants.mojom.h" |
| 123 #include "services/preferences/public/cpp/pref_service_main.h" | 122 #include "services/preferences/public/cpp/pref_service_main.h" |
| 124 #include "services/preferences/public/interfaces/preferences.mojom.h" | 123 #include "services/preferences/public/interfaces/preferences.mojom.h" |
| 125 #include "services/preferences/public/interfaces/tracked_preference_validation_d
elegate.mojom.h" | 124 #include "services/preferences/public/interfaces/tracked_preference_validation_d
elegate.mojom.h" |
| 126 #include "services/service_manager/public/cpp/service.h" | 125 #include "services/service_manager/public/cpp/service.h" |
| 127 #include "ui/base/l10n/l10n_util.h" | 126 #include "ui/base/l10n/l10n_util.h" |
| 128 | 127 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 SupervisedUserSettingsService* supervised_user_settings = nullptr; | 478 SupervisedUserSettingsService* supervised_user_settings = nullptr; |
| 480 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 479 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 481 supervised_user_settings = | 480 supervised_user_settings = |
| 482 SupervisedUserSettingsServiceFactory::GetForProfile(this); | 481 SupervisedUserSettingsServiceFactory::GetForProfile(this); |
| 483 supervised_user_settings->Init( | 482 supervised_user_settings->Init( |
| 484 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); | 483 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); |
| 485 #endif | 484 #endif |
| 486 | 485 |
| 487 scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service( | 486 scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service( |
| 488 g_browser_process->safe_browsing_service()); | 487 g_browser_process->safe_browsing_service()); |
| 489 prefs::mojom::TrackedPreferenceValidationDelegatePtr pref_validation_delegate; | |
| 490 if (safe_browsing_service.get()) { | 488 if (safe_browsing_service.get()) { |
| 491 auto pref_validation_delegate_impl = | 489 pref_validation_delegate_ = |
| 492 safe_browsing_service->CreatePreferenceValidationDelegate(this); | 490 safe_browsing_service->CreatePreferenceValidationDelegate(this); |
| 493 if (pref_validation_delegate_impl) { | |
| 494 mojo::MakeStrongBinding(std::move(pref_validation_delegate_impl), | |
| 495 mojo::MakeRequest(&pref_validation_delegate)); | |
| 496 } | |
| 497 } | 491 } |
| 498 | 492 |
| 499 content::BrowserContext::Initialize(this, path_); | 493 content::BrowserContext::Initialize(this, path_); |
| 500 | 494 |
| 501 { | 495 { |
| 502 service_manager::Connector* connector = nullptr; | 496 service_manager::Connector* connector = nullptr; |
| 503 if (features::PrefServiceEnabled()) { | 497 if (features::PrefServiceEnabled()) { |
| 504 connector = content::BrowserContext::GetConnectorFor(this); | 498 connector = content::BrowserContext::GetConnectorFor(this); |
| 505 } | 499 } |
| 506 prefs_ = chrome_prefs::CreateProfilePrefs( | 500 prefs_ = chrome_prefs::CreateProfilePrefs( |
| 507 path_, std::move(pref_validation_delegate), | 501 path_, sequenced_task_runner, pref_validation_delegate_.get(), |
| 508 profile_policy_connector_->policy_service(), supervised_user_settings, | 502 profile_policy_connector_->policy_service(), supervised_user_settings, |
| 509 CreateExtensionPrefStore(this, false), pref_registry_, async_prefs, | 503 CreateExtensionPrefStore(this, false), pref_registry_, async_prefs, |
| 510 connector); | 504 connector); |
| 511 // Register on BrowserContext. | 505 // Register on BrowserContext. |
| 512 user_prefs::UserPrefs::Set(this, prefs_.get()); | 506 user_prefs::UserPrefs::Set(this, prefs_.get()); |
| 513 } | 507 } |
| 514 | 508 |
| 515 if (async_prefs) { | 509 if (async_prefs) { |
| 516 // Wait for the notification that prefs has been loaded | 510 // Wait for the notification that prefs has been loaded |
| 517 // (successfully or not). Note that we can use base::Unretained | 511 // (successfully or not). Note that we can use base::Unretained |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1344 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); |
| 1351 | 1345 |
| 1352 return service->CreateMonitor( | 1346 return service->CreateMonitor( |
| 1353 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 1347 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 1354 } | 1348 } |
| 1355 | 1349 |
| 1356 std::unique_ptr<service_manager::Service> ProfileImpl::CreateIdentityService() { | 1350 std::unique_ptr<service_manager::Service> ProfileImpl::CreateIdentityService() { |
| 1357 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile(this); | 1351 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile(this); |
| 1358 return base::MakeUnique<identity::IdentityService>(signin_manager); | 1352 return base::MakeUnique<identity::IdentityService>(signin_manager); |
| 1359 } | 1353 } |
| OLD | NEW |