Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 2759413002: Move PrefStoreManagerImpl into //services/preferences. (Closed)
Patch Set: Update newly-added test. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | services/preferences/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/browser/user_metrics.h" 115 #include "content/public/browser/user_metrics.h"
116 #include "content/public/common/content_constants.h" 116 #include "content/public/common/content_constants.h"
117 #include "content/public/common/page_zoom.h" 117 #include "content/public/common/page_zoom.h"
118 #include "extensions/features/features.h" 118 #include "extensions/features/features.h"
119 #include "ppapi/features/features.h" 119 #include "ppapi/features/features.h"
120 #include "printing/features/features.h" 120 #include "printing/features/features.h"
121 #include "services/preferences/public/cpp/pref_store_manager_impl.h" 121 #include "services/preferences/public/cpp/pref_service_main.h"
122 #include "services/preferences/public/interfaces/preferences.mojom.h" 122 #include "services/preferences/public/interfaces/preferences.mojom.h"
123 #include "services/preferences/public/interfaces/tracked_preference_validation_d elegate.mojom.h" 123 #include "services/preferences/public/interfaces/tracked_preference_validation_d elegate.mojom.h"
124 #include "services/service_manager/public/cpp/service.h"
124 #include "ui/base/l10n/l10n_util.h" 125 #include "ui/base/l10n/l10n_util.h"
125 126
126 #if defined(OS_CHROMEOS) 127 #if defined(OS_CHROMEOS)
127 #include "chrome/browser/chromeos/locale_change_guard.h" 128 #include "chrome/browser/chromeos/locale_change_guard.h"
128 #include "chrome/browser/chromeos/preferences.h" 129 #include "chrome/browser/chromeos/preferences.h"
129 #include "chrome/browser/chromeos/profiles/profile_helper.h" 130 #include "chrome/browser/chromeos/profiles/profile_helper.h"
130 #include "chrome/browser/chromeos/settings/device_settings_service.h" 131 #include "chrome/browser/chromeos/settings/device_settings_service.h"
131 #include "components/user_manager/user_manager.h" 132 #include "components/user_manager/user_manager.h"
132 #endif 133 #endif
133 134
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 ProfileImpl::CreateMediaRequestContextForStoragePartition( 1061 ProfileImpl::CreateMediaRequestContextForStoragePartition(
1061 const base::FilePath& partition_path, 1062 const base::FilePath& partition_path,
1062 bool in_memory) { 1063 bool in_memory) {
1063 return io_data_ 1064 return io_data_
1064 .GetIsolatedMediaRequestContextGetter(partition_path, in_memory).get(); 1065 .GetIsolatedMediaRequestContextGetter(partition_path, in_memory).get();
1065 } 1066 }
1066 1067
1067 void ProfileImpl::RegisterInProcessServices(StaticServiceMap* services) { 1068 void ProfileImpl::RegisterInProcessServices(StaticServiceMap* services) {
1068 if (base::FeatureList::IsEnabled(features::kPrefService)) { 1069 if (base::FeatureList::IsEnabled(features::kPrefService)) {
1069 content::ServiceInfo info; 1070 content::ServiceInfo info;
1070 info.factory = 1071 info.factory = base::Bind(
1071 base::Bind([]() -> std::unique_ptr<service_manager::Service> { 1072 &prefs::CreatePrefService, std::set<PrefValueStore::PrefStoreType>(),
1072 return base::MakeUnique<prefs::PrefStoreManagerImpl>( 1073 make_scoped_refptr(content::BrowserThread::GetBlockingPool()));
1073 prefs::PrefStoreManagerImpl::PrefStoreTypes(), 1074 info.task_runner = content::BrowserThread::GetTaskRunnerForThread(
1074 content::BrowserThread::GetBlockingPool()); 1075 content::BrowserThread::IO);
1075 });
1076 services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info)); 1076 services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info));
1077 } 1077 }
1078 } 1078 }
1079 1079
1080 bool ProfileImpl::IsSameProfile(Profile* profile) { 1080 bool ProfileImpl::IsSameProfile(Profile* profile) {
1081 if (profile == static_cast<Profile*>(this)) 1081 if (profile == static_cast<Profile*>(this))
1082 return true; 1082 return true;
1083 Profile* otr_profile = off_the_record_profile_.get(); 1083 Profile* otr_profile = off_the_record_profile_.get();
1084 return otr_profile && profile == otr_profile; 1084 return otr_profile && profile == otr_profile;
1085 } 1085 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { 1326 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) {
1327 domain_reliability::DomainReliabilityService* service = 1327 domain_reliability::DomainReliabilityService* service =
1328 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1328 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1329 GetForBrowserContext(this); 1329 GetForBrowserContext(this);
1330 if (!service) 1330 if (!service)
1331 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); 1331 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>();
1332 1332
1333 return service->CreateMonitor( 1333 return service->CreateMonitor(
1334 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 1334 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
1335 } 1335 }
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | services/preferences/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698