Index: sync/notifier/invalidation_notifier.cc |
diff --git a/sync/notifier/invalidation_notifier.cc b/sync/notifier/invalidation_notifier.cc |
index 3a72f32fa61ace7acc53ca566d9ccfe210599e51..8c6871b7bb22aded9f837d5ba30ea13d83467ce8 100644 |
--- a/sync/notifier/invalidation_notifier.cc |
+++ b/sync/notifier/invalidation_notifier.cc |
@@ -34,10 +34,22 @@ InvalidationNotifier::~InvalidationNotifier() { |
DCHECK(CalledOnValidThread()); |
} |
+void InvalidationNotifier::RegisterHandler(SyncNotifierObserver* handler) { |
+ DCHECK(CalledOnValidThread()); |
+ registrar_.RegisterHandler(handler); |
+} |
+ |
void InvalidationNotifier::UpdateRegisteredIds(SyncNotifierObserver* handler, |
const ObjectIdSet& ids) { |
DCHECK(CalledOnValidThread()); |
- invalidation_client_.RegisterIds(helper_.UpdateRegisteredIds(handler, ids)); |
+ registrar_.UpdateRegisteredIds(handler, ids); |
+ const ObjectIdSet& all_registered_ids = registrar_.GetAllRegisteredIds(); |
+ invalidation_client_.RegisterIds(all_registered_ids); |
msw
2012/08/09 05:20:26
nit: pass registrar_.GetAllRegisteredIds() and nix
akalin
2012/08/10 01:28:08
Done.
|
+} |
+ |
+void InvalidationNotifier::UnregisterHandler(SyncNotifierObserver* handler) { |
+ DCHECK(CalledOnValidThread()); |
+ registrar_.UnregisterHandler(handler); |
} |
void InvalidationNotifier::SetUniqueId(const std::string& unique_id) { |
@@ -88,18 +100,18 @@ void InvalidationNotifier::SendNotification(ModelTypeSet changed_types) { |
void InvalidationNotifier::OnInvalidate(const ObjectIdPayloadMap& id_payloads) { |
DCHECK(CalledOnValidThread()); |
- helper_.DispatchInvalidationsToHandlers(id_payloads, REMOTE_NOTIFICATION); |
+ registrar_.DispatchInvalidationsToHandlers(id_payloads, REMOTE_NOTIFICATION); |
} |
void InvalidationNotifier::OnNotificationsEnabled() { |
DCHECK(CalledOnValidThread()); |
- helper_.EmitOnNotificationsEnabled(); |
+ registrar_.EmitOnNotificationsEnabled(); |
} |
void InvalidationNotifier::OnNotificationsDisabled( |
NotificationsDisabledReason reason) { |
DCHECK(CalledOnValidThread()); |
- helper_.EmitOnNotificationsDisabled(reason); |
+ registrar_.EmitOnNotificationsDisabled(reason); |
} |
} // namespace syncer |