| 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_IMPL_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "components/gcm_driver/gcm_client.h" | 21 #include "components/gcm_driver/gcm_client.h" |
| 22 #include "components/gcm_driver/gcm_stats_recorder_impl.h" | 22 #include "components/gcm_driver/gcm_stats_recorder_impl.h" |
| 23 #include "google_apis/gcm/base/mcs_message.h" | 23 #include "google_apis/gcm/base/mcs_message.h" |
| 24 #include "google_apis/gcm/engine/gcm_store.h" | 24 #include "google_apis/gcm/engine/gcm_store.h" |
| 25 #include "google_apis/gcm/engine/gservices_settings.h" | 25 #include "google_apis/gcm/engine/gservices_settings.h" |
| 26 #include "google_apis/gcm/engine/mcs_client.h" | 26 #include "google_apis/gcm/engine/mcs_client.h" |
| 27 #include "google_apis/gcm/engine/registration_request.h" | 27 #include "google_apis/gcm/engine/registration_request.h" |
| 28 #include "google_apis/gcm/engine/unregistration_request.h" | 28 #include "google_apis/gcm/engine/unregistration_request.h" |
| 29 #include "google_apis/gcm/protocol/android_checkin.pb.h" | 29 #include "google_apis/gcm/protocol/android_checkin.pb.h" |
| 30 #include "google_apis/gcm/protocol/checkin.pb.h" | 30 #include "google_apis/gcm/protocol/checkin.pb.h" |
| 31 #include "net/http/http_status_code.h" |
| 31 #include "net/url_request/url_request_context_getter.h" | 32 #include "net/url_request/url_request_context_getter.h" |
| 32 | 33 |
| 33 class GURL; | 34 class GURL; |
| 34 | 35 |
| 35 namespace base { | 36 namespace base { |
| 36 class Clock; | 37 class Clock; |
| 37 class Time; | 38 class Time; |
| 38 } // namespace base | 39 } // namespace base |
| 39 | 40 |
| 40 namespace mcs_proto { | 41 namespace mcs_proto { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // Sets state to ready. This will initiate the MCS login and notify the | 224 // Sets state to ready. This will initiate the MCS login and notify the |
| 224 // delegates. | 225 // delegates. |
| 225 void OnReady(const std::vector<AccountMapping>& account_mappings, | 226 void OnReady(const std::vector<AccountMapping>& account_mappings, |
| 226 const base::Time& last_token_fetch_time); | 227 const base::Time& last_token_fetch_time); |
| 227 | 228 |
| 228 // Starts a first time device checkin. | 229 // Starts a first time device checkin. |
| 229 void StartCheckin(); | 230 void StartCheckin(); |
| 230 // Completes the device checkin request by parsing the |checkin_response|. | 231 // Completes the device checkin request by parsing the |checkin_response|. |
| 231 // Function also cleans up the pending checkin. | 232 // Function also cleans up the pending checkin. |
| 232 void OnCheckinCompleted( | 233 void OnCheckinCompleted( |
| 234 net::HttpStatusCode response_code, |
| 233 const checkin_proto::AndroidCheckinResponse& checkin_response); | 235 const checkin_proto::AndroidCheckinResponse& checkin_response); |
| 234 | 236 |
| 235 // Callback passed to GCMStore::SetGServicesSettings. | 237 // Callback passed to GCMStore::SetGServicesSettings. |
| 236 void SetGServicesSettingsCallback(bool success); | 238 void SetGServicesSettingsCallback(bool success); |
| 237 | 239 |
| 238 // Schedules next periodic device checkin and makes sure there is at most one | 240 // Schedules next periodic device checkin and makes sure there is at most one |
| 239 // pending checkin at a time. This function is meant to be called after a | 241 // pending checkin at a time. This function is meant to be called after a |
| 240 // successful checkin. | 242 // successful checkin. |
| 241 void SchedulePeriodicCheckin(); | 243 void SchedulePeriodicCheckin(); |
| 242 // Gets the time until next checkin. | 244 // Gets the time until next checkin. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 384 |
| 383 // Factory for creating references in callbacks. | 385 // Factory for creating references in callbacks. |
| 384 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; | 386 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; |
| 385 | 387 |
| 386 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); | 388 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); |
| 387 }; | 389 }; |
| 388 | 390 |
| 389 } // namespace gcm | 391 } // namespace gcm |
| 390 | 392 |
| 391 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ | 393 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ |
| OLD | NEW |