summaryrefslogtreecommitdiffstats
path: root/sync/tools
diff options
context:
space:
mode:
Diffstat (limited to 'sync/tools')
-rw-r--r--sync/tools/sync_listen_notifications.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc
index 22b22d6..25ebcbd 100644
--- a/sync/tools/sync_listen_notifications.cc
+++ b/sync/tools/sync_listen_notifications.cc
@@ -63,10 +63,8 @@ class NotificationPrinter : public SyncNotifierObserver {
}
virtual void OnIncomingNotification(
- const ObjectIdPayloadMap& id_payloads,
+ const ModelTypePayloadMap& type_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")
@@ -235,17 +233,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->UpdateRegisteredIds(
- &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All()));
+ sync_notifier->UpdateEnabledTypes(ModelTypeSet::All());
ui_loop.Run();
- sync_notifier->UpdateRegisteredIds(&notification_printer, ObjectIdSet());
+ sync_notifier->RemoveObserver(&notification_printer);
io_thread.Stop();
return 0;
}