Index: sync/notifier/p2p_notifier.cc |
=================================================================== |
--- sync/notifier/p2p_notifier.cc (revision 150991) |
+++ sync/notifier/p2p_notifier.cc (working copy) |
@@ -157,18 +157,10 @@ |
push_client_->RemoveObserver(this); |
} |
-void P2PNotifier::RegisterHandler(SyncNotifierObserver* handler) { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- registrar_.RegisterHandler(handler); |
-} |
- |
void P2PNotifier::UpdateRegisteredIds(SyncNotifierObserver* handler, |
const ObjectIdSet& ids) { |
- // TODO(akalin): Handle arbitrary object IDs (http://crbug.com/140411). |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- registrar_.UpdateRegisteredIds(handler, ids); |
- const ModelTypeSet enabled_types = |
- ObjectIdSetToModelTypeSet(registrar_.GetAllRegisteredIds()); |
+ const ModelTypeSet enabled_types = ObjectIdSetToModelTypeSet( |
+ helper_.UpdateRegisteredIds(handler, ids)); |
const ModelTypeSet new_enabled_types = |
Difference(enabled_types, enabled_types_); |
const P2PNotificationData notification_data( |
@@ -177,11 +169,6 @@ |
enabled_types_ = enabled_types; |
} |
-void P2PNotifier::UnregisterHandler(SyncNotifierObserver* handler) { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- registrar_.UnregisterHandler(handler); |
-} |
- |
void P2PNotifier::SetUniqueId(const std::string& unique_id) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
unique_id_ = unique_id; |
@@ -220,7 +207,7 @@ |
DCHECK(thread_checker_.CalledOnValidThread()); |
bool just_turned_on = (notifications_enabled_ == false); |
notifications_enabled_ = true; |
- registrar_.EmitOnNotificationsEnabled(); |
+ helper_.EmitOnNotificationsEnabled(); |
if (just_turned_on) { |
const P2PNotificationData notification_data( |
unique_id_, NOTIFY_SELF, enabled_types_); |
@@ -231,7 +218,7 @@ |
void P2PNotifier::OnNotificationsDisabled( |
notifier::NotificationsDisabledReason reason) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
- registrar_.EmitOnNotificationsDisabled(FromNotifierReason(reason)); |
+ helper_.EmitOnNotificationsDisabled(FromNotifierReason(reason)); |
} |
void P2PNotifier::OnIncomingNotification( |
@@ -270,7 +257,7 @@ |
} |
const ModelTypePayloadMap& type_payloads = ModelTypePayloadMapFromEnumSet( |
notification_data.GetChangedTypes(), std::string()); |
- registrar_.DispatchInvalidationsToHandlers( |
+ helper_.DispatchInvalidationsToHandlers( |
ModelTypePayloadMapToObjectIdPayloadMap(type_payloads), |
REMOTE_NOTIFICATION); |
} |