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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Enables/disables GCM service. | 87 // Enables/disables GCM service. |
88 virtual void Enable() = 0; | 88 virtual void Enable() = 0; |
89 virtual void Disable() = 0; | 89 virtual void Disable() = 0; |
90 | 90 |
91 // For testing purpose. Always NULL on Android. | 91 // For testing purpose. Always NULL on Android. |
92 virtual GCMClient* GetGCMClientForTesting() const = 0; | 92 virtual GCMClient* GetGCMClientForTesting() const = 0; |
93 | 93 |
94 // Returns true if the service was started. | 94 // Returns true if the service was started. |
95 virtual bool IsStarted() const = 0; | 95 virtual bool IsStarted() const = 0; |
96 | 96 |
97 // Returns true if the gcm client is ready. | |
98 virtual bool IsGCMClientReady() const = 0; | |
99 | |
100 // Returns true if the gcm client has an open and active connection. | 97 // Returns true if the gcm client has an open and active connection. |
101 virtual bool IsConnected() const = 0; | 98 virtual bool IsConnected() const = 0; |
102 | 99 |
103 // Get GCM client internal states and statistics. | 100 // Get GCM client internal states and statistics. |
104 // If clear_logs is true then activity logs will be cleared before the stats | 101 // If clear_logs is true then activity logs will be cleared before the stats |
105 // are returned. | 102 // are returned. |
106 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, | 103 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, |
107 bool clear_logs) = 0; | 104 bool clear_logs) = 0; |
108 | 105 |
109 // Enables/disables GCM activity recording, and then returns the stats. | 106 // Enables/disables GCM activity recording, and then returns the stats. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 161 |
165 // The default handler when no app handler can be found in the map. | 162 // The default handler when no app handler can be found in the map. |
166 DefaultGCMAppHandler default_app_handler_; | 163 DefaultGCMAppHandler default_app_handler_; |
167 | 164 |
168 DISALLOW_COPY_AND_ASSIGN(GCMDriver); | 165 DISALLOW_COPY_AND_ASSIGN(GCMDriver); |
169 }; | 166 }; |
170 | 167 |
171 } // namespace gcm | 168 } // namespace gcm |
172 | 169 |
173 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 170 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
OLD | NEW |