| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 Delegate* delegate) = 0; | 239 Delegate* delegate) = 0; |
| 240 | 240 |
| 241 // Starts the GCM service by first loading the data from the persistent store. | 241 // Starts the GCM service by first loading the data from the persistent store. |
| 242 // This will then kick off the check-in if the check-in info is not found in | 242 // This will then kick off the check-in if the check-in info is not found in |
| 243 // the store. | 243 // the store. |
| 244 virtual void Start() = 0; | 244 virtual void Start() = 0; |
| 245 | 245 |
| 246 // Stops using the GCM service. This will not erase the persisted data. | 246 // Stops using the GCM service. This will not erase the persisted data. |
| 247 virtual void Stop() = 0; | 247 virtual void Stop() = 0; |
| 248 | 248 |
| 249 // Checks out of the GCM service. This will erase all the cached and persisted | |
| 250 // data. | |
| 251 virtual void CheckOut() = 0; | |
| 252 | |
| 253 // Registers the application for GCM. Delegate::OnRegisterFinished will be | 249 // Registers the application for GCM. Delegate::OnRegisterFinished will be |
| 254 // called asynchronously upon completion. | 250 // called asynchronously upon completion. |
| 255 // |app_id|: application ID. | 251 // |app_id|: application ID. |
| 256 // |sender_ids|: list of IDs of the servers that are allowed to send the | 252 // |sender_ids|: list of IDs of the servers that are allowed to send the |
| 257 // messages to the application. These IDs are assigned by the | 253 // messages to the application. These IDs are assigned by the |
| 258 // Google API Console. | 254 // Google API Console. |
| 259 virtual void Register(const std::string& app_id, | 255 virtual void Register(const std::string& app_id, |
| 260 const std::vector<std::string>& sender_ids) = 0; | 256 const std::vector<std::string>& sender_ids) = 0; |
| 261 | 257 |
| 262 // Unregisters the application from GCM when it is uninstalled. | 258 // Unregisters the application from GCM when it is uninstalled. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 // Sets last token fetch time in persistent store. | 295 // Sets last token fetch time in persistent store. |
| 300 virtual void SetLastTokenFetchTime(const base::Time& time) = 0; | 296 virtual void SetLastTokenFetchTime(const base::Time& time) = 0; |
| 301 | 297 |
| 302 // Updates the timer used by the HeartbeatManager for sending heartbeats. | 298 // Updates the timer used by the HeartbeatManager for sending heartbeats. |
| 303 virtual void UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) = 0; | 299 virtual void UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) = 0; |
| 304 }; | 300 }; |
| 305 | 301 |
| 306 } // namespace gcm | 302 } // namespace gcm |
| 307 | 303 |
| 308 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 304 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
| OLD | NEW |