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 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 | 230 |
231 void DeviceCloudPolicyInitializer::EnrollmentCompleted( | 231 void DeviceCloudPolicyInitializer::EnrollmentCompleted( |
232 const EnrollmentCallback& enrollment_callback, | 232 const EnrollmentCallback& enrollment_callback, |
233 EnrollmentStatus status) { | 233 EnrollmentStatus status) { |
234 std::unique_ptr<CloudPolicyClient> client = | 234 std::unique_ptr<CloudPolicyClient> client = |
235 enrollment_handler_->ReleaseClient(); | 235 enrollment_handler_->ReleaseClient(); |
236 enrollment_handler_.reset(); | 236 enrollment_handler_.reset(); |
237 | 237 |
238 if (status.status() == EnrollmentStatus::STATUS_SUCCESS) { | 238 if (status.status() == EnrollmentStatus::STATUS_SUCCESS) { |
239 StartConnection(std::move(client)); | 239 StartConnection(std::move(client)); |
240 // Request policy refresh, as some new policy types (e.g. component | |
241 // policies) could be added for fetching when the connection was started by | |
242 // the device cloud policy manager. | |
243 manager_->RefreshPolicies(); | |
Andrew T Wilson (Slow)
2016/10/28 14:49:56
This is fine, but curious why StartConnection() do
emaxx
2016/10/31 15:51:20
Usually the first policy fetch happens as the resu
Andrew T Wilson (Slow)
2016/10/31 20:44:11
I don't have a great idea here - I've never really
| |
240 } else { | 244 } else { |
241 // Some attempts to create a client may be blocked because the enrollment | 245 // Some attempts to create a client may be blocked because the enrollment |
242 // was in progress. We give it a try again. | 246 // was in progress. We give it a try again. |
243 TryToCreateClient(); | 247 TryToCreateClient(); |
244 } | 248 } |
245 | 249 |
246 if (!enrollment_callback.is_null()) | 250 if (!enrollment_callback.is_null()) |
247 enrollment_callback.Run(status); | 251 enrollment_callback.Run(status); |
248 } | 252 } |
249 | 253 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 if (success && (success = att_signed_data.ParseFromString(signed_data))) { | 322 if (success && (success = att_signed_data.ParseFromString(signed_data))) { |
319 em_signed_data.set_data(att_signed_data.data()); | 323 em_signed_data.set_data(att_signed_data.data()); |
320 em_signed_data.set_signature(att_signed_data.signature()); | 324 em_signed_data.set_signature(att_signed_data.signature()); |
321 em_signed_data.set_extra_data_bytes(att_signed_data.data().size() - | 325 em_signed_data.set_extra_data_bytes(att_signed_data.data().size() - |
322 data.size()); | 326 data.size()); |
323 } | 327 } |
324 callback.Run(success, em_signed_data); | 328 callback.Run(success, em_signed_data); |
325 } | 329 } |
326 | 330 |
327 } // namespace policy | 331 } // namespace policy |
OLD | NEW |