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

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

Issue 2759413002: Move PrefStoreManagerImpl into //services/preferences. (Closed)
Patch Set: 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
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #include "content/public/browser/notification_service.h" 110 #include "content/public/browser/notification_service.h"
111 #include "content/public/browser/render_process_host.h" 111 #include "content/public/browser/render_process_host.h"
112 #include "content/public/browser/storage_partition.h" 112 #include "content/public/browser/storage_partition.h"
113 #include "content/public/browser/url_data_source.h" 113 #include "content/public/browser/url_data_source.h"
114 #include "content/public/browser/user_metrics.h" 114 #include "content/public/browser/user_metrics.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 "ppapi/features/features.h" 118 #include "ppapi/features/features.h"
119 #include "printing/features/features.h" 119 #include "printing/features/features.h"
120 #include "services/preferences/public/cpp/pref_store_manager_impl.h" 120 #include "services/preferences/public/cpp/pref_service_main.h"
121 #include "services/preferences/public/interfaces/preferences.mojom.h" 121 #include "services/preferences/public/interfaces/preferences.mojom.h"
122 #include "services/preferences/public/interfaces/tracked_preference_validation_d elegate.mojom.h" 122 #include "services/preferences/public/interfaces/tracked_preference_validation_d elegate.mojom.h"
123 #include "services/service_manager/public/cpp/service.h"
123 #include "ui/base/l10n/l10n_util.h" 124 #include "ui/base/l10n/l10n_util.h"
124 125
125 #if defined(OS_CHROMEOS) 126 #if defined(OS_CHROMEOS)
126 #include "chrome/browser/chromeos/locale_change_guard.h" 127 #include "chrome/browser/chromeos/locale_change_guard.h"
127 #include "chrome/browser/chromeos/preferences.h" 128 #include "chrome/browser/chromeos/preferences.h"
128 #include "chrome/browser/chromeos/profiles/profile_helper.h" 129 #include "chrome/browser/chromeos/profiles/profile_helper.h"
129 #include "chrome/browser/chromeos/settings/device_settings_service.h" 130 #include "chrome/browser/chromeos/settings/device_settings_service.h"
130 #include "components/user_manager/user_manager.h" 131 #include "components/user_manager/user_manager.h"
131 #endif 132 #endif
132 133
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 net::URLRequestContextGetter* 1057 net::URLRequestContextGetter*
1057 ProfileImpl::CreateMediaRequestContextForStoragePartition( 1058 ProfileImpl::CreateMediaRequestContextForStoragePartition(
1058 const base::FilePath& partition_path, 1059 const base::FilePath& partition_path,
1059 bool in_memory) { 1060 bool in_memory) {
1060 return io_data_ 1061 return io_data_
1061 .GetIsolatedMediaRequestContextGetter(partition_path, in_memory).get(); 1062 .GetIsolatedMediaRequestContextGetter(partition_path, in_memory).get();
1062 } 1063 }
1063 1064
1064 void ProfileImpl::RegisterInProcessServices(StaticServiceMap* services) { 1065 void ProfileImpl::RegisterInProcessServices(StaticServiceMap* services) {
1065 if (base::FeatureList::IsEnabled(features::kPrefService)) { 1066 if (base::FeatureList::IsEnabled(features::kPrefService)) {
1066 content::ServiceInfo info; 1067 content::ServiceInfo info;
Mike Lerman 2017/03/21 13:32:40 You're iterating on this within the Profiles direc
Sam McNally 2017/03/21 23:10:51 Unfortunately, those aren't viable options due to
1067 info.factory = 1068 info.factory = base::Bind(
1068 base::Bind([]() -> std::unique_ptr<service_manager::Service> { 1069 &prefs::CreatePrefService, std::set<PrefValueStore::PrefStoreType>(),
1069 return base::MakeUnique<prefs::PrefStoreManagerImpl>( 1070 make_scoped_refptr(content::BrowserThread::GetBlockingPool()));
1070 prefs::PrefStoreManagerImpl::PrefStoreTypes(),
1071 content::BrowserThread::GetBlockingPool());
1072 });
1073 services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info)); 1071 services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info));
1074 } 1072 }
1075 } 1073 }
1076 1074
1077 bool ProfileImpl::IsSameProfile(Profile* profile) { 1075 bool ProfileImpl::IsSameProfile(Profile* profile) {
1078 if (profile == static_cast<Profile*>(this)) 1076 if (profile == static_cast<Profile*>(this))
1079 return true; 1077 return true;
1080 Profile* otr_profile = off_the_record_profile_.get(); 1078 Profile* otr_profile = off_the_record_profile_.get();
1081 return otr_profile && profile == otr_profile; 1079 return otr_profile && profile == otr_profile;
1082 } 1080 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { 1321 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) {
1324 domain_reliability::DomainReliabilityService* service = 1322 domain_reliability::DomainReliabilityService* service =
1325 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1323 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1326 GetForBrowserContext(this); 1324 GetForBrowserContext(this);
1327 if (!service) 1325 if (!service)
1328 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); 1326 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>();
1329 1327
1330 return service->CreateMonitor( 1328 return service->CreateMonitor(
1331 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 1329 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
1332 } 1330 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698