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

Unified Diff: components/policy/core/common/configuration_policy_provider.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browsertest and removed unnecessary string for default values. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/configuration_policy_provider.cc
diff --git a/components/policy/core/common/configuration_policy_provider.cc b/components/policy/core/common/configuration_policy_provider.cc
index 03fd8d7dd2accc22da17dec26372dcc034bebed8..7c56454ddd9e59206bc70f934d7d56058af1278e 100644
--- a/components/policy/core/common/configuration_policy_provider.cc
+++ b/components/policy/core/common/configuration_policy_provider.cc
@@ -43,15 +43,24 @@ bool ConfigurationPolicyProvider::IsInitializationComplete(
void ConfigurationPolicyProvider::UpdatePolicy(
scoped_ptr<PolicyBundle> bundle) {
- if (bundle.get())
+ if (bundle.get()) {
policy_bundle_.Swap(bundle.get());
- else
+ SetSources(source());
Thiemo Nagel 2015/09/01 17:40:37 Not sure whether that makes any difference (can th
fhorschig 2015/09/04 06:53:54 The poorly named function SetSources sets the sour
+ } else {
policy_bundle_.Clear();
+ }
FOR_EACH_OBSERVER(ConfigurationPolicyProvider::Observer,
observer_list_,
OnUpdatePolicy(this));
}
+void ConfigurationPolicyProvider::SetSources(PolicySource source) {
+ for (PolicyBundle::iterator it = policy_bundle_.begin();
+ it != policy_bundle_.end(); ++it) {
+ it->second->SetSources(source);
+ }
+}
+
SchemaRegistry* ConfigurationPolicyProvider::schema_registry() const {
return schema_registry_;
}

Powered by Google App Engine
This is Rietveld 408576698