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
3// found in the LICENSE file.
4
5#include "chrome/browser/chromeos/policy/fake_device_cloud_policy_initializer.h"
6
7#include "base/bind.h"
8#include "base/bind_helpers.h"
9#include "base/memory/ref_counted.h"
10#include "base/sequenced_task_runner.h"
11#include "components/policy/core/common/cloud/device_management_service.h"
12
13namespace policy {
14
15FakeDeviceCloudPolicyInitializer::FakeDeviceCloudPolicyInitializer()
16    : DeviceCloudPolicyInitializer(
17          NULL,  // local_state
18          NULL,  // enterprise_service
19          NULL,  // consumer_service
20          // background_task_runner
21          scoped_refptr<base::SequencedTaskRunner>(NULL),
22          NULL,  // install_attributes
23          NULL,  // state_keys_broker
24          NULL,  // device_store
25          NULL,  // manager
26          NULL,  // device_settings_service
27          // on_connected_callback
28          base::Bind(&base::DoNothing)),
29      was_start_enrollment_called_(false),
30      enrollment_status_(EnrollmentStatus::ForStatus(
31          EnrollmentStatus::STATUS_SUCCESS)) {
32}
33
34void FakeDeviceCloudPolicyInitializer::Init() {
35}
36
37void FakeDeviceCloudPolicyInitializer::Shutdown() {
38}
39
40void FakeDeviceCloudPolicyInitializer::StartEnrollment(
41    enterprise_management::PolicyData::ManagementMode management_mode,
42    DeviceManagementService* device_management_service,
43    const std::string& auth_token,
44    bool is_auto_enrollment,
45    const AllowedDeviceModes& allowed_modes,
46    const EnrollmentCallback& enrollment_callback) {
47  was_start_enrollment_called_ = true;
48  enrollment_callback.Run(enrollment_status_);
49}
50
51}  // namespace policy
52