summaryrefslogtreecommitdiffstats
path: root/chrome/browser/policy/testing_cloud_policy_subsystem.cc
blob: 619accb5a19a28609336b0edc19e6f1e1d6f86e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/policy/testing_cloud_policy_subsystem.h"

#include "chrome/browser/policy/cloud_policy_controller.h"
#include "chrome/browser/policy/device_token_fetcher.h"
#include "chrome/browser/policy/logging_work_scheduler.h"

namespace policy {

TestingCloudPolicySubsystem::TestingCloudPolicySubsystem(
    CloudPolicyIdentityStrategy* identity_strategy,
    CloudPolicyCacheBase* policy_cache,
    const std::string& device_management_url,
    EventLogger* logger)
        : CloudPolicySubsystem(),
          logger_(logger) {
  Initialize(identity_strategy, policy_cache, device_management_url);
}

void TestingCloudPolicySubsystem::CreateDeviceTokenFetcher() {
  device_token_fetcher_.reset(
      new DeviceTokenFetcher(device_management_service_.get(),
                             cloud_policy_cache_.get(),
                             notifier_.get(),
                             new LoggingWorkScheduler(logger_)));
}

void TestingCloudPolicySubsystem::CreateCloudPolicyController() {
  cloud_policy_controller_.reset(
      new CloudPolicyController(device_management_service_.get(),
                                cloud_policy_cache_.get(),
                                device_token_fetcher_.get(),
                                identity_strategy_,
                                notifier_.get(),
                                new LoggingWorkScheduler(logger_)));
}

}  // namespace policy