| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const std::string& receiver_id, | 65 const std::string& receiver_id, |
| 66 const GCMClient::OutgoingMessage& message, | 66 const GCMClient::OutgoingMessage& message, |
| 67 const SendCallback& callback); | 67 const SendCallback& callback); |
| 68 | 68 |
| 69 const GCMAppHandlerMap& app_handlers() const { return app_handlers_; } | 69 const GCMAppHandlerMap& app_handlers() const { return app_handlers_; } |
| 70 | 70 |
| 71 // This method must be called before destroying the GCMDriver. Once it has | 71 // This method must be called before destroying the GCMDriver. Once it has |
| 72 // been called, no other GCMDriver methods may be used. | 72 // been called, no other GCMDriver methods may be used. |
| 73 virtual void Shutdown(); | 73 virtual void Shutdown(); |
| 74 | 74 |
| 75 // Call this method when the user signs in to a GAIA account. | 75 // Called when the user signs in to or out of a GAIA account. |
| 76 // TODO(jianli): To be removed when sign-in enforcement is dropped. | |
| 77 virtual void OnSignedIn() = 0; | 76 virtual void OnSignedIn() = 0; |
| 77 virtual void OnSignedOut() = 0; |
| 78 | 78 |
| 79 // Removes all the cached and persisted GCM data. If the GCM service is | 79 // Removes all the cached and persisted GCM data. If the GCM service is |
| 80 // restarted after the purge, a new Android ID will be obtained. | 80 // restarted after the purge, a new Android ID will be obtained. |
| 81 virtual void Purge() = 0; | 81 virtual void Purge() = 0; |
| 82 | 82 |
| 83 // Adds a handler for a given app. | 83 // Adds a handler for a given app. |
| 84 virtual void AddAppHandler(const std::string& app_id, GCMAppHandler* handler); | 84 virtual void AddAppHandler(const std::string& app_id, GCMAppHandler* handler); |
| 85 | 85 |
| 86 // Remove the handler for a given app. | 86 // Remove the handler for a given app. |
| 87 virtual void RemoveAppHandler(const std::string& app_id); | 87 virtual void RemoveAppHandler(const std::string& app_id); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 // The default handler when no app handler can be found in the map. | 180 // The default handler when no app handler can be found in the map. |
| 181 DefaultGCMAppHandler default_app_handler_; | 181 DefaultGCMAppHandler default_app_handler_; |
| 182 | 182 |
| 183 DISALLOW_COPY_AND_ASSIGN(GCMDriver); | 183 DISALLOW_COPY_AND_ASSIGN(GCMDriver); |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 } // namespace gcm | 186 } // namespace gcm |
| 187 | 187 |
| 188 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 188 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
| OLD | NEW |