| 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/fake_device_cloud_policy_initializer.h" | 5 #include "chrome/browser/chromeos/policy/fake_device_cloud_policy_initializer.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
| 10 #include "chromeos/attestation/mock_attestation_flow.h" | 10 #include "chromeos/attestation/mock_attestation_flow.h" |
| 11 #include "components/policy/core/common/cloud/device_management_service.h" | 11 #include "components/policy/core/common/cloud/device_management_service.h" |
| 12 | 12 |
| 13 namespace policy { | 13 namespace policy { |
| 14 | 14 |
| 15 FakeDeviceCloudPolicyInitializer::FakeDeviceCloudPolicyInitializer() | 15 FakeDeviceCloudPolicyInitializer::FakeDeviceCloudPolicyInitializer() |
| 16 : DeviceCloudPolicyInitializer( | 16 : DeviceCloudPolicyInitializer( |
| 17 NULL, // local_state | 17 nullptr, // local_state |
| 18 NULL, // enterprise_service | 18 nullptr, // enterprise_service |
| 19 // background_task_runner | 19 // background_task_runner |
| 20 scoped_refptr<base::SequencedTaskRunner>(NULL), | 20 scoped_refptr<base::SequencedTaskRunner>(nullptr), |
| 21 NULL, // install_attributes | 21 nullptr, // install_attributes |
| 22 NULL, // state_keys_broker | 22 nullptr, // state_keys_broker |
| 23 NULL, // device_store | 23 nullptr, // device_store |
| 24 NULL, // manager | 24 nullptr, // manager |
| 25 NULL, // async_caller | 25 nullptr, // async_caller |
| 26 base::MakeUnique<chromeos::attestation::MockAttestationFlow>()), | 26 base::MakeUnique<chromeos::attestation::MockAttestationFlow>(), |
| 27 nullptr), // statistics_provider |
| 27 was_start_enrollment_called_(false), | 28 was_start_enrollment_called_(false), |
| 28 enrollment_status_( | 29 enrollment_status_( |
| 29 EnrollmentStatus::ForStatus(EnrollmentStatus::STATUS_SUCCESS)) {} | 30 EnrollmentStatus::ForStatus(EnrollmentStatus::STATUS_SUCCESS)) {} |
| 30 | 31 |
| 31 void FakeDeviceCloudPolicyInitializer::Init() { | 32 void FakeDeviceCloudPolicyInitializer::Init() { |
| 32 } | 33 } |
| 33 | 34 |
| 34 void FakeDeviceCloudPolicyInitializer::Shutdown() { | 35 void FakeDeviceCloudPolicyInitializer::Shutdown() { |
| 35 } | 36 } |
| 36 | 37 |
| 37 void FakeDeviceCloudPolicyInitializer::StartEnrollment( | 38 void FakeDeviceCloudPolicyInitializer::StartEnrollment( |
| 38 DeviceManagementService* device_management_service, | 39 DeviceManagementService* device_management_service, |
| 39 const EnrollmentConfig& enrollment_config, | 40 const EnrollmentConfig& enrollment_config, |
| 40 const std::string& auth_token, | 41 const std::string& auth_token, |
| 41 const EnrollmentCallback& enrollment_callback) { | 42 const EnrollmentCallback& enrollment_callback) { |
| 42 was_start_enrollment_called_ = true; | 43 was_start_enrollment_called_ = true; |
| 43 enrollment_callback.Run(enrollment_status_); | 44 enrollment_callback.Run(enrollment_status_); |
| 44 } | 45 } |
| 45 | 46 |
| 46 } // namespace policy | 47 } // namespace policy |
| OLD | NEW |