| 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_DRIVER_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const GCMAppHandlerMap& app_handlers() const { return app_handlers_; } | 67 const GCMAppHandlerMap& app_handlers() const { return app_handlers_; } |
| 68 | 68 |
| 69 // This method must be called before destroying the GCMDriver. Once it has | 69 // This method must be called before destroying the GCMDriver. Once it has |
| 70 // been called, no other GCMDriver methods may be used. | 70 // been called, no other GCMDriver methods may be used. |
| 71 virtual void Shutdown(); | 71 virtual void Shutdown(); |
| 72 | 72 |
| 73 // Called when the user signs in to or out of a GAIA account. | 73 // Called when the user signs in to or out of a GAIA account. |
| 74 virtual void OnSignedIn() = 0; | 74 virtual void OnSignedIn() = 0; |
| 75 virtual void OnSignedOut() = 0; | 75 virtual void OnSignedOut() = 0; |
| 76 | 76 |
| 77 // Removes all the cached and persisted GCM data. If the GCM service is | |
| 78 // restarted after the purge, a new Android ID will be obtained. | |
| 79 virtual void Purge() = 0; | |
| 80 | |
| 81 // Adds a handler for a given app. | 77 // Adds a handler for a given app. |
| 82 virtual void AddAppHandler(const std::string& app_id, GCMAppHandler* handler); | 78 virtual void AddAppHandler(const std::string& app_id, GCMAppHandler* handler); |
| 83 | 79 |
| 84 // Remove the handler for a given app. | 80 // Remove the handler for a given app. |
| 85 virtual void RemoveAppHandler(const std::string& app_id); | 81 virtual void RemoveAppHandler(const std::string& app_id); |
| 86 | 82 |
| 87 // Returns the handler for the given app. | 83 // Returns the handler for the given app. |
| 88 GCMAppHandler* GetAppHandler(const std::string& app_id); | 84 GCMAppHandler* GetAppHandler(const std::string& app_id); |
| 89 | 85 |
| 90 // Adds a connection state observer. | 86 // Adds a connection state observer. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 DefaultGCMAppHandler default_app_handler_; | 195 DefaultGCMAppHandler default_app_handler_; |
| 200 | 196 |
| 201 base::WeakPtrFactory<GCMDriver> weak_ptr_factory_; | 197 base::WeakPtrFactory<GCMDriver> weak_ptr_factory_; |
| 202 | 198 |
| 203 DISALLOW_COPY_AND_ASSIGN(GCMDriver); | 199 DISALLOW_COPY_AND_ASSIGN(GCMDriver); |
| 204 }; | 200 }; |
| 205 | 201 |
| 206 } // namespace gcm | 202 } // namespace gcm |
| 207 | 203 |
| 208 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 204 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
| OLD | NEW |