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 15047b045c6c69b89e4118a14c8418902dd65166..cae2d688116ac004b582dc387355954fb3f98ffc 100644 |
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc |
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc |
@@ -87,10 +87,14 @@ ProfileSyncComponentsFactoryImpl::ProfileSyncComponentsFactoryImpl( |
Profile* profile, CommandLine* command_line) |
: profile_(profile), |
command_line_(command_line), |
+#if defined(OS_ANDROID) |
+ extension_system_(NULL) { |
nilesh
2012/07/27 00:59:07
I think we include ExtensionSystemFactory and this
|
+#else |
extension_system_( |
extensions::ExtensionSystemFactory::GetForProfile(profile)), |
web_data_service_(WebDataServiceFactory::GetForProfile( |
profile_, Profile::IMPLICIT_ACCESS)) { |
+#endif |
} |
ProfileSyncComponentsFactoryImpl::~ProfileSyncComponentsFactoryImpl() { |
@@ -98,6 +102,38 @@ ProfileSyncComponentsFactoryImpl::~ProfileSyncComponentsFactoryImpl() { |
void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( |
ProfileSyncService* pss) { |
+ RegisterCommonDataTypes(pss); |
+#if !defined(OS_ANDROID) |
+ RegisterDesktopDataTypes(pss); |
+#endif |
+} |
+ |
+void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( |
+ ProfileSyncService* pss) { |
+ // Bookmark sync is enabled by default. Register unless explicitly |
+ // disabled. |
+ if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { |
+ pss->RegisterDataTypeController( |
+ new BookmarkDataTypeController(this, profile_, pss)); |
+ } |
+ |
+ // TypedUrl sync is enabled by default. Register unless explicitly disabled, |
+ // or if saving history is disabled. |
+ if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && |
+ !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { |
+ pss->RegisterDataTypeController( |
+ new TypedUrlDataTypeController(this, profile_, pss)); |
+ } |
+ |
+ // Session sync is enabled by default. Register unless explicitly disabled. |
+ if (!command_line_->HasSwitch(switches::kDisableSyncTabs)) { |
+ pss->RegisterDataTypeController( |
+ new SessionDataTypeController(this, profile_, pss)); |
+ } |
+} |
+ |
+void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( |
+ ProfileSyncService* pss) { |
// App sync is enabled by default. Register unless explicitly |
// disabled. |
if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { |
@@ -112,13 +148,6 @@ void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( |
new AutofillDataTypeController(this, profile_, pss)); |
} |
- // Bookmark sync is enabled by default. Register unless explicitly |
- // disabled. |
- if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { |
- pss->RegisterDataTypeController( |
- new BookmarkDataTypeController(this, profile_, pss)); |
- } |
- |
// Extension sync is enabled by default. Register unless explicitly |
// disabled. |
if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { |
@@ -149,14 +178,6 @@ void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( |
} |
#endif |
- // TypedUrl sync is enabled by default. Register unless explicitly disabled, |
- // or if saving history is disabled. |
- if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && |
- !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { |
- pss->RegisterDataTypeController( |
- new TypedUrlDataTypeController(this, profile_, pss)); |
- } |
- |
// Search Engine sync is enabled by default. Register only if explicitly |
// disabled. |
if (!command_line_->HasSwitch(switches::kDisableSyncSearchEngines)) { |
@@ -164,12 +185,6 @@ void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( |
new SearchEngineDataTypeController(this, profile_, pss)); |
} |
- // Session sync is enabled by default. Register unless explicitly disabled. |
- if (!command_line_->HasSwitch(switches::kDisableSyncTabs)) { |
- pss->RegisterDataTypeController( |
- new SessionDataTypeController(this, profile_, pss)); |
- } |
- |
// Extension setting sync is enabled by default. Register unless explicitly |
// disabled. |
if (!command_line_->HasSwitch(switches::kDisableSyncExtensionSettings)) { |
@@ -247,8 +262,14 @@ base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: |
return TemplateURLServiceFactory::GetForProfile(profile_)->AsWeakPtr(); |
case syncer::APP_SETTINGS: |
case syncer::EXTENSION_SETTINGS: |
+#if defined(OS_ANDROID) |
+ // Android does not sync application or extension settings. |
+ NOTREACHED(); |
+ return base::WeakPtr<syncer::SyncableService>(); |
+#else |
return extension_system_->extension_service()->settings_frontend()-> |
GetBackendForSync(type)->AsWeakPtr(); |
+#endif |
case syncer::APP_NOTIFICATIONS: |
return extension_system_->extension_service()-> |
app_notification_manager()->AsWeakPtr(); |