OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // A notifier that uses p2p notifications based on XMPP push | 5 // A notifier that uses p2p notifications based on XMPP push |
6 // notifications. Used only for sync integration tests. | 6 // notifications. Used only for sync integration tests. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_P2P_NOTIFIER_H_ | 8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_P2P_NOTIFIER_H_ |
9 #define CHROME_BROWSER_SYNC_NOTIFIER_P2P_NOTIFIER_H_ | 9 #define CHROME_BROWSER_SYNC_NOTIFIER_P2P_NOTIFIER_H_ |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; | 102 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; |
103 virtual void SetState(const std::string& state) OVERRIDE; | 103 virtual void SetState(const std::string& state) OVERRIDE; |
104 virtual void UpdateCredentials( | 104 virtual void UpdateCredentials( |
105 const std::string& email, const std::string& token) OVERRIDE; | 105 const std::string& email, const std::string& token) OVERRIDE; |
106 virtual void UpdateEnabledTypes( | 106 virtual void UpdateEnabledTypes( |
107 const syncable::ModelTypeSet& enabled_types) OVERRIDE; | 107 const syncable::ModelTypeSet& enabled_types) OVERRIDE; |
108 virtual void SendNotification( | 108 virtual void SendNotification( |
109 const syncable::ModelTypeSet& changed_types) OVERRIDE; | 109 const syncable::ModelTypeSet& changed_types) OVERRIDE; |
110 | 110 |
111 // TalkMediator::Delegate implementation. | 111 // TalkMediator::Delegate implementation. |
112 virtual void OnNotificationStateChange(bool notifications_enabled); | 112 virtual void OnNotificationStateChange(bool notifications_enabled) OVERRIDE; |
113 virtual void OnIncomingNotification( | 113 virtual void OnIncomingNotification( |
114 const notifier::Notification& notification); | 114 const notifier::Notification& notification) OVERRIDE; |
115 virtual void OnOutgoingNotification(); | 115 virtual void OnOutgoingNotification() OVERRIDE; |
116 | 116 |
117 // For testing. | 117 // For testing. |
118 void SendNotificationDataForTest( | 118 void SendNotificationDataForTest( |
119 const P2PNotificationData& notification_data); | 119 const P2PNotificationData& notification_data); |
120 | 120 |
121 private: | 121 private: |
122 void SendNotificationData(const P2PNotificationData& notification_data); | 122 void SendNotificationData(const P2PNotificationData& notification_data); |
123 | 123 |
124 ObserverList<SyncNotifierObserver> observer_list_; | 124 ObserverList<SyncNotifierObserver> observer_list_; |
125 | 125 |
126 // The actual notification listener. | 126 // The actual notification listener. |
127 scoped_ptr<notifier::TalkMediator> talk_mediator_; | 127 scoped_ptr<notifier::TalkMediator> talk_mediator_; |
128 // Our unique ID. | 128 // Our unique ID. |
129 std::string unique_id_; | 129 std::string unique_id_; |
130 // Whether we called Login() on |talk_mediator_| yet. | 130 // Whether we called Login() on |talk_mediator_| yet. |
131 bool logged_in_; | 131 bool logged_in_; |
132 // Whether |talk_mediator_| has notified us that notifications are | 132 // Whether |talk_mediator_| has notified us that notifications are |
133 // enabled. | 133 // enabled. |
134 bool notifications_enabled_; | 134 bool notifications_enabled_; |
135 // Which set of clients should be sent notifications. | 135 // Which set of clients should be sent notifications. |
136 P2PNotificationTarget send_notification_target_; | 136 P2PNotificationTarget send_notification_target_; |
137 | 137 |
138 syncable::ModelTypeSet enabled_types_; | 138 syncable::ModelTypeSet enabled_types_; |
139 scoped_refptr<base::MessageLoopProxy> parent_message_loop_proxy_; | 139 scoped_refptr<base::MessageLoopProxy> parent_message_loop_proxy_; |
140 }; | 140 }; |
141 | 141 |
142 } // namespace sync_notifier | 142 } // namespace sync_notifier |
143 #endif // CHROME_BROWSER_SYNC_NOTIFIER_P2P_NOTIFIER_H_ | 143 #endif // CHROME_BROWSER_SYNC_NOTIFIER_P2P_NOTIFIER_H_ |
OLD | NEW |