1 // Copyright (c) 2011 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/policy/mock_device_management_service.h"
6
7 namespace policy {
8
ProxyDeviceManagementBackend(DeviceManagementBackend * backend)9 ProxyDeviceManagementBackend::ProxyDeviceManagementBackend(
10 DeviceManagementBackend* backend)
11 : backend_(backend) {
12 }
~ProxyDeviceManagementBackend()13 ProxyDeviceManagementBackend::~ProxyDeviceManagementBackend() {}
14
ProcessRegisterRequest(const std::string & auth_token,const std::string & device_id,const em::DeviceRegisterRequest & request,DeviceRegisterResponseDelegate * delegate)15 void ProxyDeviceManagementBackend::ProcessRegisterRequest(
16 const std::string& auth_token,
17 const std::string& device_id,
18 const em::DeviceRegisterRequest& request,
19 DeviceRegisterResponseDelegate* delegate) {
20 backend_->ProcessRegisterRequest(auth_token, device_id, request, delegate);
21 }
22
ProcessUnregisterRequest(const std::string & device_management_token,const std::string & device_id,const em::DeviceUnregisterRequest & request,DeviceUnregisterResponseDelegate * delegate)23 void ProxyDeviceManagementBackend::ProcessUnregisterRequest(
24 const std::string& device_management_token,
25 const std::string& device_id,
26 const em::DeviceUnregisterRequest& request,
27 DeviceUnregisterResponseDelegate* delegate) {
28 backend_->ProcessUnregisterRequest(device_management_token, device_id,
29 request, delegate);
30 }
ProcessPolicyRequest(const std::string & device_management_token,const std::string & device_id,const em::DevicePolicyRequest & request,DevicePolicyResponseDelegate * delegate)31 void ProxyDeviceManagementBackend::ProcessPolicyRequest(
32 const std::string& device_management_token,
33 const std::string& device_id,
34 const em::DevicePolicyRequest& request,
35 DevicePolicyResponseDelegate* delegate) {
36 backend_->ProcessPolicyRequest(device_management_token, device_id,
37 request, delegate);
38 }
39
MockDeviceManagementService()40 MockDeviceManagementService::MockDeviceManagementService()
41 : DeviceManagementService(""),
42 backend_(NULL) {}
43
~MockDeviceManagementService()44 MockDeviceManagementService::~MockDeviceManagementService() {}
45
CreateBackend()46 DeviceManagementBackend* MockDeviceManagementService::CreateBackend() {
47 return new ProxyDeviceManagementBackend(backend_);
48 }
49
50 } // namespace policy
51