summaryrefslogtreecommitdiffstats
path: root/sync/tools
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-21 19:40:33 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-21 19:40:33 +0000
commit877197584abc8883cbccc3bd83240a9be6c2e16e (patch)
tree36da6824a41c80c87f1b95dc1c8cf1f4a9e4571c /sync/tools
parent8e2dd2741c41e5090aee5f8bc31349ff6d9c0fed (diff)
downloadchromium_src-877197584abc8883cbccc3bd83240a9be6c2e16e.zip
chromium_src-877197584abc8883cbccc3bd83240a9be6c2e16e.tar.gz
chromium_src-877197584abc8883cbccc3bd83240a9be6c2e16e.tar.bz2
Refactor sync-specific parts out of SyncNotifier/SyncNotifierObserver
Sort of. SendNotification() is still there. Perhaps we want to split the interfaces completely. BUG=124149 TEST=tests should still pass, no observable behavior change Review URL: https://chromiumcodereview.appspot.com/10702074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/tools')
-rw-r--r--sync/tools/sync_listen_notifications.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc
index 25ebcbd..22b22d6 100644
--- a/sync/tools/sync_listen_notifications.cc
+++ b/sync/tools/sync_listen_notifications.cc
@@ -63,8 +63,10 @@ class NotificationPrinter : public SyncNotifierObserver {
}
virtual void OnIncomingNotification(
- const ModelTypePayloadMap& type_payloads,
+ const ObjectIdPayloadMap& id_payloads,
IncomingNotificationSource source) OVERRIDE {
+ const ModelTypePayloadMap& type_payloads =
+ ObjectIdPayloadMapToModelTypePayloadMap(id_payloads);
for (ModelTypePayloadMap::const_iterator it =
type_payloads.begin(); it != type_payloads.end(); ++it) {
LOG(INFO) << (source == REMOTE_NOTIFICATION ? "Remote" : "Local")
@@ -233,17 +235,17 @@ int SyncListenNotificationsMain(int argc, char* argv[]) {
scoped_ptr<SyncNotifier> sync_notifier(
sync_notifier_factory.CreateSyncNotifier());
NotificationPrinter notification_printer;
- sync_notifier->AddObserver(&notification_printer);
const char kUniqueId[] = "fake_unique_id";
sync_notifier->SetUniqueId(kUniqueId);
sync_notifier->UpdateCredentials(email, token);
// Listen for notifications for all known types.
- sync_notifier->UpdateEnabledTypes(ModelTypeSet::All());
+ sync_notifier->UpdateRegisteredIds(
+ &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All()));
ui_loop.Run();
- sync_notifier->RemoveObserver(&notification_printer);
+ sync_notifier->UpdateRegisteredIds(&notification_printer, ObjectIdSet());
io_thread.Stop();
return 0;
}