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

Unified Diff: chrome/browser/policy/configuration_policy_handler.cc

Issue 16658015: Add device policies to control accessibility settings on the login screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed leaky tests. Created 7 years, 6 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: chrome/browser/policy/configuration_policy_handler.cc
diff --git a/chrome/browser/policy/configuration_policy_handler.cc b/chrome/browser/policy/configuration_policy_handler.cc
index be6524f238f969ce41987b01f376f44bbc03f70b..07120fbe374794069e40a79f1f454a18ab3b7003 100644
--- a/chrome/browser/policy/configuration_policy_handler.cc
+++ b/chrome/browser/policy/configuration_policy_handler.cc
@@ -292,6 +292,8 @@ bool StringToIntEnumListPolicyHandler::CheckPolicySettings(
void StringToIntEnumListPolicyHandler::ApplyPolicySettings(
const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!pref_path_)
+ return;
const base::Value* value = policies.GetValue(policy_name());
scoped_ptr<base::ListValue> list(new base::ListValue());
if (value && Convert(value, list.get(), NULL))
@@ -360,6 +362,8 @@ IntRangePolicyHandler::~IntRangePolicyHandler() {
void IntRangePolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!pref_path_)
+ return;
const base::Value* value = policies.GetValue(policy_name());
int value_in_range;
if (value && EnsureInRange(value, &value_in_range, NULL)) {
@@ -386,6 +390,8 @@ IntPercentageToDoublePolicyHandler::~IntPercentageToDoublePolicyHandler() {
void IntPercentageToDoublePolicyHandler::ApplyPolicySettings(
const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!pref_path_)
+ return;
const base::Value* value = policies.GetValue(policy_name());
int percentage;
if (value && EnsureInRange(value, &percentage, NULL)) {
@@ -616,6 +622,8 @@ bool ExtensionURLPatternListPolicyHandler::CheckPolicySettings(
void ExtensionURLPatternListPolicyHandler::ApplyPolicySettings(
const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!pref_path_)
+ return;
const Value* value = policies.GetValue(policy_name());
if (value)
prefs->SetValue(pref_path_, value->DeepCopy());
@@ -636,6 +644,8 @@ SimplePolicyHandler::~SimplePolicyHandler() {
void SimplePolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!pref_path_)
+ return;
const Value* value = policies.GetValue(policy_name());
if (value)
prefs->SetValue(pref_path_, value->DeepCopy());

Powered by Google App Engine
This is Rietveld 408576698