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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 bool connection_client_created; | 134 bool connection_client_created; |
135 std::string connection_state; | 135 std::string connection_state; |
136 uint64 android_id; | 136 uint64 android_id; |
137 std::vector<std::string> registered_app_ids; | 137 std::vector<std::string> registered_app_ids; |
138 int send_queue_size; | 138 int send_queue_size; |
139 int resend_queue_size; | 139 int resend_queue_size; |
140 | 140 |
141 RecordedActivities recorded_activities; | 141 RecordedActivities recorded_activities; |
142 }; | 142 }; |
143 | 143 |
144 // Information about account and access token for that account. | |
jianli
2014/09/02 18:00:10
"Information about account" should be good enough
fgorski
2014/09/03 21:37:02
Done.
| |
145 // That information can be used for checkin or account mapping. | |
146 struct AccountTokenInfo { | |
147 std::string account_id; | |
148 std::string email; | |
149 std::string access_token; | |
150 }; | |
151 | |
144 // A delegate interface that allows the GCMClient instance to interact with | 152 // A delegate interface that allows the GCMClient instance to interact with |
145 // its caller, i.e. notifying asynchronous event. | 153 // its caller, i.e. notifying asynchronous event. |
146 class Delegate { | 154 class Delegate { |
147 public: | 155 public: |
148 // Called when the registration completed successfully or an error occurs. | 156 // Called when the registration completed successfully or an error occurs. |
149 // |app_id|: application ID. | 157 // |app_id|: application ID. |
150 // |registration_id|: non-empty if the registration completed successfully. | 158 // |registration_id|: non-empty if the registration completed successfully. |
151 // |result|: the type of the error if an error occured, success otherwise. | 159 // |result|: the type of the error if an error occured, success otherwise. |
152 virtual void OnRegisterFinished(const std::string& app_id, | 160 virtual void OnRegisterFinished(const std::string& app_id, |
153 const std::string& registration_id, | 161 const std::string& registration_id, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; | 290 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; |
283 | 291 |
284 // Removes the account mapping related to |account_id| from the persistent | 292 // Removes the account mapping related to |account_id| from the persistent |
285 // store. | 293 // store. |
286 virtual void RemoveAccountMapping(const std::string& account_id) = 0; | 294 virtual void RemoveAccountMapping(const std::string& account_id) = 0; |
287 }; | 295 }; |
288 | 296 |
289 } // namespace gcm | 297 } // namespace gcm |
290 | 298 |
291 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 299 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
OLD | NEW |