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 // An implementation of SyncNotifier that wraps an invalidation | 5 // An implementation of SyncNotifier that wraps an invalidation |
6 // client. Handles the details of connecting to XMPP and hooking it | 6 // client. Handles the details of connecting to XMPP and hooking it |
7 // up to the invalidation client. | 7 // up to the invalidation client. |
8 // | 8 // |
9 // You probably don't want to use this directly; use | 9 // You probably don't want to use this directly; use |
10 // NonBlockingInvalidationNotifier. | 10 // NonBlockingInvalidationNotifier. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 virtual void UpdateCredentials( | 57 virtual void UpdateCredentials( |
58 const std::string& email, const std::string& token) OVERRIDE; | 58 const std::string& email, const std::string& token) OVERRIDE; |
59 virtual void UpdateEnabledTypes( | 59 virtual void UpdateEnabledTypes( |
60 syncable::ModelTypeSet enabled_types) OVERRIDE; | 60 syncable::ModelTypeSet enabled_types) OVERRIDE; |
61 virtual void SendNotification( | 61 virtual void SendNotification( |
62 syncable::ModelTypeSet changed_types) OVERRIDE; | 62 syncable::ModelTypeSet changed_types) OVERRIDE; |
63 | 63 |
64 // ChromeInvalidationClient::Listener implementation. | 64 // ChromeInvalidationClient::Listener implementation. |
65 virtual void OnInvalidate( | 65 virtual void OnInvalidate( |
66 const syncable::ModelTypePayloadMap& type_payloads) OVERRIDE; | 66 const syncable::ModelTypePayloadMap& type_payloads) OVERRIDE; |
67 virtual void OnSessionStatusChanged(bool has_session) OVERRIDE; | 67 virtual void OnNotificationsEnabled() OVERRIDE; |
| 68 virtual void OnNotificationsDisabled( |
| 69 NotificationsDisabledReason reason) OVERRIDE; |
68 | 70 |
69 private: | 71 private: |
70 // We start off in the STOPPED state. When we get our initial | 72 // We start off in the STOPPED state. When we get our initial |
71 // credentials, we connect and move to the CONNECTING state. When | 73 // credentials, we connect and move to the CONNECTING state. When |
72 // we're connected we start the invalidation client and move to the | 74 // we're connected we start the invalidation client and move to the |
73 // STARTED state. We never go back to a previous state. | 75 // STARTED state. We never go back to a previous state. |
74 enum State { | 76 enum State { |
75 STOPPED, | 77 STOPPED, |
76 CONNECTING, | 78 CONNECTING, |
77 STARTED | 79 STARTED |
(...skipping 23 matching lines...) Expand all Loading... |
101 | 103 |
102 // The invalidation client. | 104 // The invalidation client. |
103 ChromeInvalidationClient invalidation_client_; | 105 ChromeInvalidationClient invalidation_client_; |
104 | 106 |
105 DISALLOW_COPY_AND_ASSIGN(InvalidationNotifier); | 107 DISALLOW_COPY_AND_ASSIGN(InvalidationNotifier); |
106 }; | 108 }; |
107 | 109 |
108 } // namespace sync_notifier | 110 } // namespace sync_notifier |
109 | 111 |
110 #endif // SYNC_NOTIFIER_INVALIDATION_NOTIFIER_H_ | 112 #endif // SYNC_NOTIFIER_INVALIDATION_NOTIFIER_H_ |
OLD | NEW |