Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: components/policy/core/common/cloud/mock_cloud_policy_client.cc

Issue 116273002: Added support for signed policy blobs on desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for ios. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/policy/core/common/cloud/mock_cloud_policy_client.h" 5 #include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
6 #include "net/url_request/url_request_context_getter.h" 6 #include "net/url_request/url_request_context_getter.h"
7 #include "policy/proto/device_management_backend.pb.h" 7 #include "policy/proto/device_management_backend.pb.h"
8 8
9 namespace em = enterprise_management; 9 namespace em = enterprise_management;
10 10
11 namespace policy { 11 namespace policy {
12 12
13 MockCloudPolicyClient::MockCloudPolicyClient() 13 MockCloudPolicyClient::MockCloudPolicyClient()
14 : CloudPolicyClient(std::string(), 14 : CloudPolicyClient(std::string(),
15 std::string(), 15 std::string(),
16 std::string(),
16 USER_AFFILIATION_NONE, 17 USER_AFFILIATION_NONE,
17 NULL, 18 NULL,
18 NULL, 19 NULL,
19 NULL) {} 20 NULL) {}
20 21
21 MockCloudPolicyClient::~MockCloudPolicyClient() {} 22 MockCloudPolicyClient::~MockCloudPolicyClient() {}
22 23
23 void MockCloudPolicyClient::SetDMToken(const std::string& token) { 24 void MockCloudPolicyClient::SetDMToken(const std::string& token) {
24 dm_token_ = token; 25 dm_token_ = token;
25 } 26 }
26 27
27 void MockCloudPolicyClient::SetPolicy(const PolicyNamespaceKey& policy_ns_key, 28 void MockCloudPolicyClient::SetPolicy(const PolicyNamespaceKey& policy_ns_key,
28 const em::PolicyFetchResponse& policy) { 29 const em::PolicyFetchResponse& policy) {
29 em::PolicyFetchResponse*& response = responses_[policy_ns_key]; 30 em::PolicyFetchResponse*& response = responses_[policy_ns_key];
30 delete response; 31 delete response;
31 response = new enterprise_management::PolicyFetchResponse(policy); 32 response = new enterprise_management::PolicyFetchResponse(policy);
32 } 33 }
33 34
34 void MockCloudPolicyClient::SetStatus(DeviceManagementStatus status) { 35 void MockCloudPolicyClient::SetStatus(DeviceManagementStatus status) {
35 status_ = status; 36 status_ = status;
36 } 37 }
37 38
38 MockCloudPolicyClientObserver::MockCloudPolicyClientObserver() {} 39 MockCloudPolicyClientObserver::MockCloudPolicyClientObserver() {}
39 40
40 MockCloudPolicyClientObserver::~MockCloudPolicyClientObserver() {} 41 MockCloudPolicyClientObserver::~MockCloudPolicyClientObserver() {}
41 42
42 } // namespace policy 43 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698