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

Unified Diff: chrome/browser/policy/configuration_policy_pref_store.h

Issue 22812002: Refactored ConfigurationPolicyPrefStore to not depend on chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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
« no previous file with comments | « chrome/browser/policy/DEPS ('k') | chrome/browser/policy/configuration_policy_pref_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/configuration_policy_pref_store.h
diff --git a/chrome/browser/policy/configuration_policy_pref_store.h b/chrome/browser/policy/configuration_policy_pref_store.h
index a3e53978ff3b6a17f6575037b38d45ca8e06c898..62a6850861c65f6b13843628f1d422f962c97050 100644
--- a/chrome/browser/policy/configuration_policy_pref_store.h
+++ b/chrome/browser/policy/configuration_policy_pref_store.h
@@ -14,11 +14,14 @@
#include "base/values.h"
#include "chrome/browser/policy/policy_map.h"
#include "chrome/browser/policy/policy_service.h"
+#include "chrome/browser/policy/policy_types.h"
class PrefValueMap;
namespace policy {
+class ConfigurationPolicyHandlerList;
+
// An implementation of PrefStore that bridges policy settings as read from the
// PolicyService to preferences. Converts POLICY_DOMAIN_CHROME policies a given
// PolicyLevel to their corresponding preferences.
@@ -26,9 +29,12 @@ class ConfigurationPolicyPrefStore
: public PrefStore,
public PolicyService::Observer {
public:
- // Does not take ownership of |service|. Only policies of the given |level|
- // will be mapped.
- ConfigurationPolicyPrefStore(PolicyService* service, PolicyLevel level);
+ // Does not take ownership of |service| nor |handler_list|, which must outlive
+ // the store. Only policies of the given |level| will be mapped.
+ ConfigurationPolicyPrefStore(
+ PolicyService* service,
+ const ConfigurationPolicyHandlerList* handler_list,
+ PolicyLevel level);
// PrefStore methods:
virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
@@ -44,16 +50,6 @@ class ConfigurationPolicyPrefStore
const PolicyMap& current) OVERRIDE;
virtual void OnPolicyServiceInitialized(PolicyDomain domain) OVERRIDE;
- // Creates a ConfigurationPolicyPrefStore that only provides policies that
- // have POLICY_LEVEL_MANDATORY level.
- static ConfigurationPolicyPrefStore* CreateMandatoryPolicyPrefStore(
- PolicyService* policy_service);
-
- // Creates a ConfigurationPolicyPrefStore that only provides policies that
- // have POLICY_LEVEL_RECOMMENDED level.
- static ConfigurationPolicyPrefStore* CreateRecommendedPolicyPrefStore(
- PolicyService* policy_service);
-
private:
virtual ~ConfigurationPolicyPrefStore();
@@ -68,6 +64,10 @@ class ConfigurationPolicyPrefStore
// The PolicyService from which policy settings are read.
PolicyService* policy_service_;
+ // The policy handlers used to convert policies into their corresponding
+ // preferences.
+ const ConfigurationPolicyHandlerList* handler_list_;
+
// The policy level that this PrefStore uses.
PolicyLevel level_;
« no previous file with comments | « chrome/browser/policy/DEPS ('k') | chrome/browser/policy/configuration_policy_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698