| 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 // A simple wrapper around invalidation::InvalidationClient that | 5 // A simple wrapper around invalidation::InvalidationClient that |
| 6 // handles all the startup/shutdown details and hookups. | 6 // handles all the startup/shutdown details and hookups. |
| 7 | 7 |
| 8 #ifndef SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 8 #ifndef SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
| 9 #define SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 9 #define SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 // Calls Stop(). | 67 // Calls Stop(). |
| 68 virtual ~ChromeInvalidationClient(); | 68 virtual ~ChromeInvalidationClient(); |
| 69 | 69 |
| 70 // Does not take ownership of |listener| or |state_writer|. | 70 // Does not take ownership of |listener| or |state_writer|. |
| 71 // |invalidation_state_tracker| must be initialized. | 71 // |invalidation_state_tracker| must be initialized. |
| 72 void Start( | 72 void Start( |
| 73 const std::string& client_id, const std::string& client_info, | 73 const std::string& client_id, const std::string& client_info, |
| 74 const std::string& state, | 74 const std::string& state, |
| 75 const InvalidationVersionMap& initial_max_invalidation_versions, | 75 const InvalidationVersionMap& initial_max_invalidation_versions, |
| 76 const syncer::WeakHandle<InvalidationStateTracker>& | 76 const WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, |
| 77 invalidation_state_tracker, | |
| 78 Listener* listener); | 77 Listener* listener); |
| 79 | 78 |
| 80 void UpdateCredentials(const std::string& email, const std::string& token); | 79 void UpdateCredentials(const std::string& email, const std::string& token); |
| 81 | 80 |
| 82 // Register the object IDs that we're interested in getting | 81 // Register the object IDs that we're interested in getting |
| 83 // notifications for. May be called at any time. | 82 // notifications for. May be called at any time. |
| 84 void RegisterIds(const ObjectIdSet& ids); | 83 void RegisterIds(const ObjectIdSet& ids); |
| 85 | 84 |
| 86 // invalidation::InvalidationListener implementation. | 85 // invalidation::InvalidationListener implementation. |
| 87 virtual void Ready( | 86 virtual void Ready( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 NotificationsDisabledReason GetState() const; | 131 NotificationsDisabledReason GetState() const; |
| 133 | 132 |
| 134 void EmitStateChange(); | 133 void EmitStateChange(); |
| 135 | 134 |
| 136 void EmitInvalidation(const ObjectIdPayloadMap& id_payloads); | 135 void EmitInvalidation(const ObjectIdPayloadMap& id_payloads); |
| 137 | 136 |
| 138 // Owned by |chrome_system_resources_|. | 137 // Owned by |chrome_system_resources_|. |
| 139 notifier::PushClient* const push_client_; | 138 notifier::PushClient* const push_client_; |
| 140 ChromeSystemResources chrome_system_resources_; | 139 ChromeSystemResources chrome_system_resources_; |
| 141 InvalidationVersionMap max_invalidation_versions_; | 140 InvalidationVersionMap max_invalidation_versions_; |
| 142 syncer::WeakHandle<InvalidationStateTracker> | 141 WeakHandle<InvalidationStateTracker> invalidation_state_tracker_; |
| 143 invalidation_state_tracker_; | |
| 144 Listener* listener_; | 142 Listener* listener_; |
| 145 scoped_ptr<invalidation::InvalidationClient> invalidation_client_; | 143 scoped_ptr<invalidation::InvalidationClient> invalidation_client_; |
| 146 scoped_ptr<RegistrationManager> registration_manager_; | 144 scoped_ptr<RegistrationManager> registration_manager_; |
| 147 // Stored to pass to |registration_manager_| on start. | 145 // Stored to pass to |registration_manager_| on start. |
| 148 ObjectIdSet registered_ids_; | 146 ObjectIdSet registered_ids_; |
| 149 | 147 |
| 150 // The states of the ticl and the push client (with | 148 // The states of the ticl and the push client (with |
| 151 // NO_NOTIFICATION_ERROR meaning notifications are enabled). | 149 // NO_NOTIFICATION_ERROR meaning notifications are enabled). |
| 152 NotificationsDisabledReason ticl_state_; | 150 NotificationsDisabledReason ticl_state_; |
| 153 NotificationsDisabledReason push_client_state_; | 151 NotificationsDisabledReason push_client_state_; |
| 154 | 152 |
| 155 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient); | 153 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient); |
| 156 }; | 154 }; |
| 157 | 155 |
| 158 } // namespace syncer | 156 } // namespace syncer |
| 159 | 157 |
| 160 #endif // SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 158 #endif // SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
| OLD | NEW |