| 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 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 228 |
| 229 // Request signed policy blobs to help prevent tampering on the client. | 229 // Request signed policy blobs to help prevent tampering on the client. |
| 230 fetch_request->set_signature_type(em::PolicyFetchRequest::SHA1_RSA); | 230 fetch_request->set_signature_type(em::PolicyFetchRequest::SHA1_RSA); |
| 231 if (public_key_version_valid_) | 231 if (public_key_version_valid_) |
| 232 fetch_request->set_public_key_version(public_key_version_); | 232 fetch_request->set_public_key_version(public_key_version_); |
| 233 | 233 |
| 234 fetch_request->set_verification_key_hash(kPolicyVerificationKeyHash); | 234 fetch_request->set_verification_key_hash(kPolicyVerificationKeyHash); |
| 235 | 235 |
| 236 // These fields are included only in requests for chrome policy. | 236 // These fields are included only in requests for chrome policy. |
| 237 if (IsChromePolicy(type_to_fetch.first)) { | 237 if (IsChromePolicy(type_to_fetch.first)) { |
| 238 if (submit_machine_id_ && !machine_id_.empty()) | |
| 239 fetch_request->set_machine_id(machine_id_); | |
| 240 if (!last_policy_timestamp_.is_null()) | 238 if (!last_policy_timestamp_.is_null()) |
| 241 fetch_request->set_timestamp(last_policy_timestamp_.ToJavaTime()); | 239 fetch_request->set_timestamp(last_policy_timestamp_.ToJavaTime()); |
| 242 if (!invalidation_payload_.empty()) { | 240 if (!invalidation_payload_.empty()) { |
| 243 fetch_request->set_invalidation_version(invalidation_version_); | 241 fetch_request->set_invalidation_version(invalidation_version_); |
| 244 fetch_request->set_invalidation_payload(invalidation_payload_); | 242 fetch_request->set_invalidation_payload(invalidation_payload_); |
| 245 } | 243 } |
| 246 } | 244 } |
| 247 } | 245 } |
| 248 | 246 |
| 249 // Add device state keys. | 247 // Add device state keys. |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 for (auto& observer : observers_) | 776 for (auto& observer : observers_) |
| 779 observer.OnRobotAuthCodesFetched(this); | 777 observer.OnRobotAuthCodesFetched(this); |
| 780 } | 778 } |
| 781 | 779 |
| 782 void CloudPolicyClient::NotifyClientError() { | 780 void CloudPolicyClient::NotifyClientError() { |
| 783 for (auto& observer : observers_) | 781 for (auto& observer : observers_) |
| 784 observer.OnClientError(this); | 782 observer.OnClientError(this); |
| 785 } | 783 } |
| 786 | 784 |
| 787 } // namespace policy | 785 } // namespace policy |
| OLD | NEW |