OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sync/notifier/invalidation_notifier.h" | 5 #include "sync/notifier/invalidation_notifier.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "jingle/notifier/listener/push_client.h" | 10 #include "jingle/notifier/listener/push_client.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 void InvalidationNotifier::SendNotification( | 96 void InvalidationNotifier::SendNotification( |
97 syncable::ModelTypeSet changed_types) { | 97 syncable::ModelTypeSet changed_types) { |
98 DCHECK(CalledOnValidThread()); | 98 DCHECK(CalledOnValidThread()); |
99 // Do nothing. | 99 // Do nothing. |
100 } | 100 } |
101 | 101 |
102 void InvalidationNotifier::OnInvalidate( | 102 void InvalidationNotifier::OnInvalidate( |
103 const syncable::ModelTypePayloadMap& type_payloads) { | 103 const syncable::ModelTypePayloadMap& type_payloads) { |
104 DCHECK(CalledOnValidThread()); | 104 DCHECK(CalledOnValidThread()); |
105 FOR_EACH_OBSERVER(SyncNotifierObserver, observers_, | 105 FOR_EACH_OBSERVER( |
106 OnIncomingNotification(type_payloads, | 106 SyncNotifierObserver, observers_, |
107 sync_notifier::REMOTE_NOTIFICATION)); | 107 OnIncomingNotification(type_payloads, |
| 108 sync_notifier::REMOTE_NOTIFICATION)); |
108 } | 109 } |
109 | 110 |
110 void InvalidationNotifier::OnSessionStatusChanged(bool has_session) { | 111 void InvalidationNotifier::OnNotificationsEnabled() { |
| 112 DCHECK(CalledOnValidThread()); |
111 FOR_EACH_OBSERVER(SyncNotifierObserver, observers_, | 113 FOR_EACH_OBSERVER(SyncNotifierObserver, observers_, |
112 OnNotificationStateChange(has_session)); | 114 OnNotificationsEnabled()); |
| 115 } |
| 116 |
| 117 void InvalidationNotifier::OnNotificationsDisabled( |
| 118 NotificationsDisabledReason reason) { |
| 119 DCHECK(CalledOnValidThread()); |
| 120 FOR_EACH_OBSERVER(SyncNotifierObserver, observers_, |
| 121 OnNotificationsDisabled(reason)); |
113 } | 122 } |
114 | 123 |
115 } // namespace sync_notifier | 124 } // namespace sync_notifier |
OLD | NEW |