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

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

Issue 10829019: [sync] Refactor how default sync datatypes are set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move pref registration Created 8 years, 4 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
« no previous file with comments | « chrome/browser/sync/profile_sync_components_factory_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 77cff331a9f566bd210614d01f82fbfa4190a743..92d0eaa8909cbe12fb85b426e31a4b9b454e4682 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -99,6 +99,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)) {
@@ -113,13 +145,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)) {
@@ -150,14 +175,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)) {
@@ -165,12 +182,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)) {
« no previous file with comments | « chrome/browser/sync/profile_sync_components_factory_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698