| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | 5 #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ |
| 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void OnFirstTimeDeviceCheckinCompleted(const CheckinInfo& checkin_info); | 155 void OnFirstTimeDeviceCheckinCompleted(const CheckinInfo& checkin_info); |
| 156 // Starts a login on mcs_client_. | 156 // Starts a login on mcs_client_. |
| 157 void StartMCSLogin(); | 157 void StartMCSLogin(); |
| 158 // Resets state to before initialization. | 158 // Resets state to before initialization. |
| 159 void ResetState(); | 159 void ResetState(); |
| 160 // Sets state to ready. This will initiate the MCS login and notify the | 160 // Sets state to ready. This will initiate the MCS login and notify the |
| 161 // delegates. | 161 // delegates. |
| 162 void OnReady(); | 162 void OnReady(); |
| 163 | 163 |
| 164 // Starts a first time device checkin. | 164 // Starts a first time device checkin. |
| 165 void StartCheckin(const CheckinInfo& checkin_info); | 165 void StartCheckin(); |
| 166 // Completes the device checkin request. | 166 // Completes the device checkin request. |
| 167 // |android_id| and |security_token| are expected to be non-zero or an error | 167 // |android_id| and |security_token| are expected to be non-zero or an error |
| 168 // is triggered. Function also cleans up the pending checkin. | 168 // is triggered. Function also cleans up the pending checkin. |
| 169 void OnCheckinCompleted(uint64 android_id, | 169 void OnCheckinCompleted(uint64 android_id, |
| 170 uint64 security_token); | 170 uint64 security_token); |
| 171 // Schedules next device checkin, based on |last_checkin_time| and default |
| 172 // checkin interval. |
| 173 void SchedulePeriodicCheckin(const base::Time& last_checkin_time); |
| 174 // Callback for setting last checkin time in the |gcm_store_|. |
| 175 void SetLastCheckinTimeCallback(bool success); |
| 171 | 176 |
| 172 // Callback for persisting device credentials in the |gcm_store_|. | 177 // Callback for persisting device credentials in the |gcm_store_|. |
| 173 void SetDeviceCredentialsCallback(bool success); | 178 void SetDeviceCredentialsCallback(bool success); |
| 174 | 179 |
| 175 // Callback for persisting registration info in the |gcm_store_|. | 180 // Callback for persisting registration info in the |gcm_store_|. |
| 176 void UpdateRegistrationCallback(bool success); | 181 void UpdateRegistrationCallback(bool success); |
| 177 | 182 |
| 178 // Completes the registration request. | 183 // Completes the registration request. |
| 179 void OnRegisterCompleted(const std::string& app_id, | 184 void OnRegisterCompleted(const std::string& app_id, |
| 180 const std::vector<std::string>& sender_ids, | 185 const std::vector<std::string>& sender_ids, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 259 |
| 255 // Factory for creating references in callbacks. | 260 // Factory for creating references in callbacks. |
| 256 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; | 261 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; |
| 257 | 262 |
| 258 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); | 263 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); |
| 259 }; | 264 }; |
| 260 | 265 |
| 261 } // namespace gcm | 266 } // namespace gcm |
| 262 | 267 |
| 263 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | 268 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ |
| OLD | NEW |