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

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

Issue 11745024: Synced Notification Sync Change Processor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Synced Notification Change Processor - remove unused header Created 7 years, 10 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/profiles/profile_dependency_manager.cc ('k') | chrome/chrome_browser.gypi » ('j') | 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 9c39a455dd9b6f563f04aa7a3676958cb7ee6940..0fe3a29e763404cb1fe9a9fa497656c5eb43c2cd 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -12,6 +12,10 @@
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
+#if !defined(OS_ANDROID)
+#include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
+#include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h"
+#endif
#include "chrome/browser/prefs/pref_model_associator.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/browser/profiles/profile.h"
@@ -237,6 +241,16 @@ void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes(
syncer::HISTORY_DELETE_DIRECTIVES, this, profile_, pss));
}
+ // Synced Notifications sync is disabled by default.
+ // TODO(petewil): Switch to enabled by default once datatype support is done.
+ if (command_line_->HasSwitch(switches::kEnableSyncSyncedNotifications)) {
+#if !defined(OS_ANDROID)
+ pss->RegisterDataTypeController(
+ new UIDataTypeController(
+ syncer::SYNCED_NOTIFICATIONS, this, profile_, pss));
+#endif
+ }
+
#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS)
// Dictionary sync is enabled by default.
if (!command_line_->HasSwitch(switches::kDisableSyncDictionary)) {
@@ -244,6 +258,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes(
new UIDataTypeController(syncer::DICTIONARY, this, profile_, pss));
}
#endif
+
}
DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager(
@@ -321,9 +336,21 @@ base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl::
profile_, Profile::EXPLICIT_ACCESS);
return history ? history->AsWeakPtr() : base::WeakPtr<HistoryService>();
}
+
+#if !defined(OS_ANDROID)
+ case syncer::SYNCED_NOTIFICATIONS: {
+ notifier::ChromeNotifierService* notifier_service =
+ notifier::ChromeNotifierServiceFactory::GetForProfile(
+ profile_, Profile::EXPLICIT_ACCESS);
+ return notifier_service ? notifier_service->AsWeakPtr()
+ : base::WeakPtr<syncer::SyncableService>();
+ }
+#endif
+
case syncer::DICTIONARY:
return SpellcheckServiceFactory::GetForProfile(profile_)->
GetCustomDictionary()->AsWeakPtr();
+
default:
// The following datatypes still need to be transitioned to the
// syncer::SyncableService API:
« no previous file with comments | « chrome/browser/profiles/profile_dependency_manager.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698