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 GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_ |
6 #define GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "google_apis/gcm/base/gcm_export.h" | 12 #include "google_apis/gcm/base/gcm_export.h" |
13 #include "google_apis/gcm/engine/gcm_store.h" | 13 #include "google_apis/gcm/engine/gcm_store.h" |
14 #include "google_apis/gcm/protocol/checkin.pb.h" | 14 #include "google_apis/gcm/protocol/checkin.pb.h" |
15 | 15 |
16 namespace gcm { | 16 namespace gcm { |
17 | 17 |
18 // Class responsible for handling G-services settings. It takes care of | 18 // Class responsible for handling G-services settings. It takes care of |
19 // extracting them from checkin response and storing in GCMStore. | 19 // extracting them from checkin response and storing in GCMStore. |
20 class GCM_EXPORT GServicesSettings { | 20 class GCM_EXPORT GServicesSettings { |
21 public: | 21 public: |
| 22 // Minimum periodic checkin interval in seconds. |
| 23 static const int64 kMinimumCheckinInterval; |
| 24 |
22 // Create an instance of GServicesSettings class. |gcm_store| is used to store | 25 // Create an instance of GServicesSettings class. |gcm_store| is used to store |
23 // the settings after they are extracted from checkin response. | 26 // the settings after they are extracted from checkin response. |
24 explicit GServicesSettings(GCMStore* gcm_store); | 27 explicit GServicesSettings(GCMStore* gcm_store); |
25 ~GServicesSettings(); | 28 ~GServicesSettings(); |
26 | 29 |
27 // Udpates the settings based on |checkin_response|. | 30 // Udpates the settings based on |checkin_response|. |
28 void UpdateFromCheckinResponse( | 31 void UpdateFromCheckinResponse( |
29 const checkin_proto::AndroidCheckinResponse& checkin_response); | 32 const checkin_proto::AndroidCheckinResponse& checkin_response); |
30 | 33 |
31 // Updates the settings based on |load_result|. | 34 // Updates the settings based on |load_result|. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 83 |
81 // Factory for creating references in callbacks. | 84 // Factory for creating references in callbacks. |
82 base::WeakPtrFactory<GServicesSettings> weak_ptr_factory_; | 85 base::WeakPtrFactory<GServicesSettings> weak_ptr_factory_; |
83 | 86 |
84 DISALLOW_COPY_AND_ASSIGN(GServicesSettings); | 87 DISALLOW_COPY_AND_ASSIGN(GServicesSettings); |
85 }; | 88 }; |
86 | 89 |
87 } // namespace gcm | 90 } // namespace gcm |
88 | 91 |
89 #endif // GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_ | 92 #endif // GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_ |
OLD | NEW |