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

Unified Diff: components/policy/core/browser/configuration_policy_handler.h

Issue 1019283005: Cleanup the ConfigurationPolicyHandler interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/browser/configuration_policy_handler.h
diff --git a/components/policy/core/browser/configuration_policy_handler.h b/components/policy/core/browser/configuration_policy_handler.h
index c8101d77faf7e56363a29a932dcc493c7deef932..1fdddc47d6be6d578b2ee83a8f227b2419a7ced7 100644
--- a/components/policy/core/browser/configuration_policy_handler.h
+++ b/components/policy/core/browser/configuration_policy_handler.h
@@ -55,18 +55,21 @@ class POLICY_EXPORT ConfigurationPolicyHandler {
const PolicyHandlerParameters& parameters,
PrefValueMap* prefs);
- // This is a convenience version of ApplyPolicySettingsWithParameters()
- // that leaves out the |parameters|. Anyone extending
- // ConfigurationPolicyHandler should implement either ApplyPolicySettings or
- // ApplyPolicySettingsWithParameters.
- virtual void ApplyPolicySettings(const PolicyMap& policies,
- PrefValueMap* prefs);
-
// Modifies the values of some of the policies in |policies| so that they
// are more suitable to display to the user. This can be used to remove
// sensitive values such as passwords, or to pretty-print values.
virtual void PrepareForDisplaying(PolicyMap* policies) const;
+ protected:
+ // This is a convenience version of ApplyPolicySettingsWithParameters()
+ // for derived classes that leaves out the |parameters|. Anyone extending
+ // ConfigurationPolicyHandler should implement either
+ // ApplyPolicySettingsWithParameters directly and implement
+ // ApplyPolicySettings with a NOTREACHED or implement only
+ // ApplyPolicySettings.
+ virtual void ApplyPolicySettings(const PolicyMap& policies,
+ PrefValueMap* prefs) = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandler);
};
@@ -339,6 +342,12 @@ class POLICY_EXPORT LegacyPoliciesDeprecatingPolicyHandler
// ConfigurationPolicyHandler:
bool CheckPolicySettings(const PolicyMap& policies,
PolicyErrorMap* errors) override;
+ void ApplyPolicySettingsWithParameters(
+ const policy::PolicyMap& policies,
+ const policy::PolicyHandlerParameters& parameters,
+ PrefValueMap* prefs) override;
+
+ protected:
void ApplyPolicySettings(const PolicyMap& policies,
PrefValueMap* prefs) override;

Powered by Google App Engine
This is Rietveld 408576698