| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // |callback| will be called when the operation completes. | 196 // |callback| will be called when the operation completes. |
| 197 virtual void UpdateGcmId(const std::string& gcm_id, | 197 virtual void UpdateGcmId(const std::string& gcm_id, |
| 198 const StatusCallback& callback); | 198 const StatusCallback& callback); |
| 199 | 199 |
| 200 // Adds an observer to be called back upon policy and state changes. | 200 // Adds an observer to be called back upon policy and state changes. |
| 201 void AddObserver(Observer* observer); | 201 void AddObserver(Observer* observer); |
| 202 | 202 |
| 203 // Removes the specified observer. | 203 // Removes the specified observer. |
| 204 void RemoveObserver(Observer* observer); | 204 void RemoveObserver(Observer* observer); |
| 205 | 205 |
| 206 const std::string& machine_id() const { return machine_id_; } |
| 207 const std::string& machine_model() const { return machine_model_; } |
| 208 |
| 206 void set_submit_machine_id(bool submit_machine_id) { | 209 void set_submit_machine_id(bool submit_machine_id) { |
| 207 submit_machine_id_ = submit_machine_id; | 210 submit_machine_id_ = submit_machine_id; |
| 208 } | 211 } |
| 209 | 212 |
| 210 void set_last_policy_timestamp(const base::Time& timestamp) { | 213 void set_last_policy_timestamp(const base::Time& timestamp) { |
| 211 last_policy_timestamp_ = timestamp; | 214 last_policy_timestamp_ = timestamp; |
| 212 } | 215 } |
| 213 | 216 |
| 214 void set_public_key_version(int public_key_version) { | 217 void set_public_key_version(int public_key_version) { |
| 215 public_key_version_ = public_key_version; | 218 public_key_version_ = public_key_version; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 // Data necessary for constructing policy requests. | 377 // Data necessary for constructing policy requests. |
| 375 const std::string machine_id_; | 378 const std::string machine_id_; |
| 376 const std::string machine_model_; | 379 const std::string machine_model_; |
| 377 const std::string verification_key_hash_; | 380 const std::string verification_key_hash_; |
| 378 PolicyTypeSet types_to_fetch_; | 381 PolicyTypeSet types_to_fetch_; |
| 379 std::vector<std::string> state_keys_to_upload_; | 382 std::vector<std::string> state_keys_to_upload_; |
| 380 | 383 |
| 381 std::string dm_token_; | 384 std::string dm_token_; |
| 382 DeviceMode device_mode_ = DEVICE_MODE_NOT_SET; | 385 DeviceMode device_mode_ = DEVICE_MODE_NOT_SET; |
| 383 std::string client_id_; | 386 std::string client_id_; |
| 384 bool submit_machine_id_ = false; | |
| 385 base::Time last_policy_timestamp_; | 387 base::Time last_policy_timestamp_; |
| 386 int public_key_version_ = -1; | 388 int public_key_version_ = -1; |
| 387 bool public_key_version_valid_ = false; | 389 bool public_key_version_valid_ = false; |
| 388 std::string robot_api_auth_code_; | 390 std::string robot_api_auth_code_; |
| 389 | 391 |
| 392 // Whether to send |machine_id_| as part of policy fetch. |
| 393 bool submit_machine_id_ = false; |
| 394 |
| 390 // Information for the latest policy invalidation received. | 395 // Information for the latest policy invalidation received. |
| 391 int64_t invalidation_version_ = 0; | 396 int64_t invalidation_version_ = 0; |
| 392 std::string invalidation_payload_; | 397 std::string invalidation_payload_; |
| 393 | 398 |
| 394 // The invalidation version used for the most recent fetch operation. | 399 // The invalidation version used for the most recent fetch operation. |
| 395 int64_t fetched_invalidation_version_ = 0; | 400 int64_t fetched_invalidation_version_ = 0; |
| 396 | 401 |
| 397 // Used for issuing requests to the cloud. | 402 // Used for issuing requests to the cloud. |
| 398 DeviceManagementService* service_ = nullptr; | 403 DeviceManagementService* service_ = nullptr; |
| 399 | 404 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 420 | 425 |
| 421 // Used to create tasks which run delayed on the UI thread. | 426 // Used to create tasks which run delayed on the UI thread. |
| 422 base::WeakPtrFactory<CloudPolicyClient> weak_ptr_factory_; | 427 base::WeakPtrFactory<CloudPolicyClient> weak_ptr_factory_; |
| 423 | 428 |
| 424 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); | 429 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); |
| 425 }; | 430 }; |
| 426 | 431 |
| 427 } // namespace policy | 432 } // namespace policy |
| 428 | 433 |
| 429 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ | 434 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ |
| OLD | NEW |