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

Unified Diff: components/policy/core/common/policy_map.h

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: Enum count and wording. Created 5 years, 3 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/policy_map.h
diff --git a/components/policy/core/common/policy_map.h b/components/policy/core/common/policy_map.h
index 7d0d06b80b4ba35e13154726b2dabd17d7e86a43..8480e2ff20eb0a0cf2b2c3ef3fa12c1bee82e37e 100644
--- a/components/policy/core/common/policy_map.h
+++ b/components/policy/core/common/policy_map.h
@@ -28,6 +28,9 @@ class POLICY_EXPORT PolicyMap {
base::Value* value;
ExternalDataFetcher* external_data_fetcher;
+ // For debugging and displaying only. Set by provider delivering the policy.
+ PolicySource source;
+
Entry();
// Deletes all members owned by |this|.
@@ -58,14 +61,25 @@ class POLICY_EXPORT PolicyMap {
// This is equivalent to Get(policy)->value, when it doesn't return NULL.
const base::Value* GetValue(const std::string& policy) const;
- // Takes ownership of |value| and |external_data_fetcher|. Overwrites any
- // existing information stored in the map for the key |policy|.
+ // Sets the source of every Entry in the Map to the passed |source|.
Thiemo Nagel 2015/09/08 08:09:16 Please also mention the conditional. This might c
fhorschig 2015/09/08 09:12:28 Done.
+ void SetEntrySources(PolicySource source);
+
+ // Calls |SetWithSource| with default source.
void Set(const std::string& policy,
PolicyLevel level,
PolicyScope scope,
base::Value* value,
ExternalDataFetcher* external_data_fetcher);
+ // Takes ownership of |value| and |external_data_fetcher|. Overwrites any
+ // existing information stored in the map for the key |policy|.
+ void SetWithSource(const std::string& policy,
+ PolicyLevel level,
+ PolicyScope scope,
+ base::Value* value,
+ ExternalDataFetcher* external_data_fetcher,
+ PolicySource source);
+
// Erase the given |policy|, if it exists in this map.
void Erase(const std::string& policy);

Powered by Google App Engine
This is Rietveld 408576698