| 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 base::TimeDelta timestamp( | 239 base::TimeDelta timestamp( |
| 242 last_policy_timestamp_ - base::Time::UnixEpoch()); | 240 last_policy_timestamp_ - base::Time::UnixEpoch()); |
| 243 fetch_request->set_timestamp(timestamp.InMilliseconds()); | 241 fetch_request->set_timestamp(timestamp.InMilliseconds()); |
| 244 } | 242 } |
| 245 if (!invalidation_payload_.empty()) { | 243 if (!invalidation_payload_.empty()) { |
| 246 fetch_request->set_invalidation_version(invalidation_version_); | 244 fetch_request->set_invalidation_version(invalidation_version_); |
| 247 fetch_request->set_invalidation_payload(invalidation_payload_); | 245 fetch_request->set_invalidation_payload(invalidation_payload_); |
| 248 } | 246 } |
| 249 } | 247 } |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 for (auto& observer : observers_) | 779 for (auto& observer : observers_) |
| 782 observer.OnRobotAuthCodesFetched(this); | 780 observer.OnRobotAuthCodesFetched(this); |
| 783 } | 781 } |
| 784 | 782 |
| 785 void CloudPolicyClient::NotifyClientError() { | 783 void CloudPolicyClient::NotifyClientError() { |
| 786 for (auto& observer : observers_) | 784 for (auto& observer : observers_) |
| 787 observer.OnClientError(this); | 785 observer.OnClientError(this); |
| 788 } | 786 } |
| 789 | 787 |
| 790 } // namespace policy | 788 } // namespace policy |
| OLD | NEW |