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

Unified Diff: chrome/browser/sync/profile_sync_components_factory_impl.cc

Issue 9834056: Moved WebDataService to ProfileKeyedService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upload rebase Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_components_factory_impl.cc
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc
index 3d45609b036b21063b86a9cccaecc10076d0671b..8696ce710d3e1b0a44b8cf9316eeae15a39cb4d8 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -47,6 +47,7 @@
#include "chrome/browser/webdata/autocomplete_syncable_service.h"
#include "chrome/browser/webdata/autofill_profile_syncable_service.h"
#include "chrome/browser/webdata/web_data_service.h"
+#include "chrome/browser/webdata/web_data_service_factory.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
@@ -87,7 +88,12 @@ ProfileSyncComponentsFactoryImpl::ProfileSyncComponentsFactoryImpl(
: profile_(profile),
command_line_(command_line),
extension_system_(
- ExtensionSystem::Get(profile)) {
+ ExtensionSystemFactory::GetForProfile(profile)),
+ web_data_service_(WebDataServiceFactory::GetForProfile(
+ profile_, Profile::IMPLICIT_ACCESS)) {
+}
+
+ProfileSyncComponentsFactoryImpl::~ProfileSyncComponentsFactoryImpl() {
}
void ProfileSyncComponentsFactoryImpl::RegisterDataTypes(
@@ -227,14 +233,14 @@ base::WeakPtr<SyncableService> ProfileSyncComponentsFactoryImpl::
return profile_->GetPrefs()->GetSyncableService()->AsWeakPtr();
case syncable::AUTOFILL:
case syncable::AUTOFILL_PROFILE: {
- WebDataService* wds =
- profile_->GetWebDataService(Profile::IMPLICIT_ACCESS);
- if (!wds)
+ if (!web_data_service_.get())
return base::WeakPtr<SyncableService>();
- if (type == syncable::AUTOFILL)
- return wds->GetAutocompleteSyncableService()->AsWeakPtr();
- else
- return wds->GetAutofillProfileSyncableService()->AsWeakPtr();
+ if (type == syncable::AUTOFILL) {
+ return web_data_service_->GetAutocompleteSyncableService()->AsWeakPtr();
+ } else {
+ return web_data_service_->
+ GetAutofillProfileSyncableService()->AsWeakPtr();
+ }
}
case syncable::APPS:
case syncable::EXTENSIONS:

Powered by Google App Engine
This is Rietveld 408576698