Chromium Code Reviews| 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> |
|
jianli
2014/09/25 20:26:45
This could be removed.
fgorski
2014/09/26 22:51:42
It is still used in few places.
| |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "components/gcm_driver/default_gcm_app_handler.h" | 15 #include "components/gcm_driver/default_gcm_app_handler.h" |
| 16 #include "components/gcm_driver/gcm_client.h" | 16 #include "components/gcm_driver/gcm_client.h" |
| 17 | 17 |
| 18 namespace gcm { | 18 namespace gcm { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 // Get GCM client internal states and statistics. | 111 // Get GCM client internal states and statistics. |
| 112 // If clear_logs is true then activity logs will be cleared before the stats | 112 // If clear_logs is true then activity logs will be cleared before the stats |
| 113 // are returned. | 113 // are returned. |
| 114 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, | 114 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, |
| 115 bool clear_logs) = 0; | 115 bool clear_logs) = 0; |
| 116 | 116 |
| 117 // Enables/disables GCM activity recording, and then returns the stats. | 117 // Enables/disables GCM activity recording, and then returns the stats. |
| 118 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, | 118 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, |
| 119 bool recording) = 0; | 119 bool recording) = 0; |
| 120 | 120 |
| 121 // Sets a list of accounts with OAuth2 tokens available in the system. | |
|
jianli
2014/09/25 20:26:45
It is a bit confusing by "setting a list of accoun
fgorski
2014/09/26 22:51:42
Done.
| |
| 122 // |account_tokens|: list of email addresses, account IDs and OAuth2 access | |
| 123 // tokens. | |
| 124 virtual void SetAccountTokens( | |
| 125 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) = 0; | |
| 126 | |
| 121 // Updates the |account_mapping| information in persistent store. | 127 // Updates the |account_mapping| information in persistent store. |
| 122 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; | 128 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; |
| 123 | 129 |
| 124 // Removes the account mapping information reated to |account_id| from | 130 // Removes the account mapping information reated to |account_id| from |
| 125 // persistent store. | 131 // persistent store. |
| 126 virtual void RemoveAccountMapping(const std::string& account_id) = 0; | 132 virtual void RemoveAccountMapping(const std::string& account_id) = 0; |
| 127 | 133 |
| 128 protected: | 134 protected: |
| 129 // Ensures that the GCM service starts (if necessary conditions are met). | 135 // Ensures that the GCM service starts (if necessary conditions are met). |
| 130 virtual GCMClient::Result EnsureStarted() = 0; | 136 virtual GCMClient::Result EnsureStarted() = 0; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 | 185 |
| 180 // The default handler when no app handler can be found in the map. | 186 // The default handler when no app handler can be found in the map. |
| 181 DefaultGCMAppHandler default_app_handler_; | 187 DefaultGCMAppHandler default_app_handler_; |
| 182 | 188 |
| 183 DISALLOW_COPY_AND_ASSIGN(GCMDriver); | 189 DISALLOW_COPY_AND_ASSIGN(GCMDriver); |
| 184 }; | 190 }; |
| 185 | 191 |
| 186 } // namespace gcm | 192 } // namespace gcm |
| 187 | 193 |
| 188 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 194 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
| OLD | NEW |