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

Unified Diff: components/policy/core/common/cloud/mock_cloud_policy_client.cc

Issue 762863002: Removed policy::PolicyNamespaceKey. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass values in ctors Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/cloud/mock_cloud_policy_client.cc
diff --git a/components/policy/core/common/cloud/mock_cloud_policy_client.cc b/components/policy/core/common/cloud/mock_cloud_policy_client.cc
index e36bebc1c6545b408b26d8ab2738172f85112c4a..47d120a784a2c469a43526564f643d7b0f160ce4 100644
--- a/components/policy/core/common/cloud/mock_cloud_policy_client.cc
+++ b/components/policy/core/common/cloud/mock_cloud_policy_client.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <utility>
+
#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
#include "net/url_request/url_request_context_getter.h"
#include "policy/proto/device_management_backend.pb.h"
@@ -15,9 +17,9 @@ MockCloudPolicyClient::MockCloudPolicyClient()
std::string(),
std::string(),
USER_AFFILIATION_NONE,
- NULL,
- NULL,
- NULL) {}
+ nullptr,
+ nullptr,
+ nullptr) {}
MockCloudPolicyClient::~MockCloudPolicyClient() {}
@@ -25,9 +27,11 @@ void MockCloudPolicyClient::SetDMToken(const std::string& token) {
dm_token_ = token;
}
-void MockCloudPolicyClient::SetPolicy(const PolicyNamespaceKey& policy_ns_key,
+void MockCloudPolicyClient::SetPolicy(const std::string& policy_type,
+ const std::string& settings_entity_id,
const em::PolicyFetchResponse& policy) {
- em::PolicyFetchResponse*& response = responses_[policy_ns_key];
+ em::PolicyFetchResponse*& response =
+ responses_[std::make_pair(policy_type, settings_entity_id)];
delete response;
response = new enterprise_management::PolicyFetchResponse(policy);
}

Powered by Google App Engine
This is Rietveld 408576698