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

Unified Diff: components/policy/core/common/cloud/cloud_policy_service.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/cloud_policy_service.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_service.cc b/components/policy/core/common/cloud/cloud_policy_service.cc
index f54756317d12405260bee4e0fba938c211ba2519..b09e69d0cc34ec813bffba89d7b12cf3b8da9cde 100644
--- a/components/policy/core/common/cloud/cloud_policy_service.cc
+++ b/components/policy/core/common/cloud/cloud_policy_service.cc
@@ -11,15 +11,17 @@ namespace em = enterprise_management;
namespace policy {
-CloudPolicyService::CloudPolicyService(const PolicyNamespaceKey& policy_ns_key,
+CloudPolicyService::CloudPolicyService(const std::string& policy_type,
+ const std::string& settings_entity_id,
CloudPolicyClient* client,
CloudPolicyStore* store)
- : policy_ns_key_(policy_ns_key),
+ : policy_type_(policy_type),
+ settings_entity_id_(settings_entity_id),
client_(client),
store_(store),
refresh_state_(REFRESH_NONE),
initialization_complete_(false) {
- client_->AddNamespaceToFetch(policy_ns_key_);
+ client_->AddPolicyTypeToFetch(policy_type_, settings_entity_id_);
client_->AddObserver(this);
store_->AddObserver(this);
@@ -29,7 +31,7 @@ CloudPolicyService::CloudPolicyService(const PolicyNamespaceKey& policy_ns_key,
}
CloudPolicyService::~CloudPolicyService() {
- client_->RemoveNamespaceToFetch(policy_ns_key_);
+ client_->RemovePolicyTypeToFetch(policy_type_, settings_entity_id_);
client_->RemoveObserver(this);
store_->RemoveObserver(this);
}
@@ -64,7 +66,8 @@ void CloudPolicyService::OnPolicyFetched(CloudPolicyClient* client) {
return;
}
- const em::PolicyFetchResponse* policy = client_->GetPolicyFor(policy_ns_key_);
+ const em::PolicyFetchResponse* policy =
+ client_->GetPolicyFor(policy_type_, settings_entity_id_);
if (policy) {
if (refresh_state_ != REFRESH_NONE)
refresh_state_ = REFRESH_POLICY_STORE;

Powered by Google App Engine
This is Rietveld 408576698