Index: sync/notifier/p2p_notifier.cc |
diff --git a/sync/notifier/p2p_notifier.cc b/sync/notifier/p2p_notifier.cc |
index e2a4209bfdd3b8bd0d363df1978a36cf97b97e36..c4fcfbe649eab9dd939630969d76165031d42984 100644 |
--- a/sync/notifier/p2p_notifier.cc |
+++ b/sync/notifier/p2p_notifier.cc |
@@ -260,13 +260,14 @@ void P2PNotifier::OnIncomingNotification( |
<< "not emitting notification"; |
return; |
} |
- if (notification_data.GetChangedTypes().Empty()) { |
- DVLOG(1) << "No changed types -- not emitting notification"; |
+ const ModelTypeSet types_to_notify = |
+ Intersection(enabled_types_, notification_data.GetChangedTypes()); |
+ if (types_to_notify.Empty()) { |
+ DVLOG(1) << "No enabled and changed types -- not emitting notification"; |
return; |
} |
const ModelTypePayloadMap& type_payloads = |
- ModelTypePayloadMapFromEnumSet( |
- notification_data.GetChangedTypes(), std::string()); |
+ ModelTypePayloadMapFromEnumSet(types_to_notify, std::string()); |
FOR_EACH_OBSERVER(SyncNotifierObserver, observer_list_, |
OnIncomingNotification(type_payloads, REMOTE_NOTIFICATION)); |
} |