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

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: Fix copy&paste mistake found by clang. 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..032e3a4b6ab30693f4c0d1266ae8b3799210da2b 100644
--- a/chrome/browser/policy/configuration_policy_handler.cc
+++ b/chrome/browser/policy/configuration_policy_handler.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/policy/configuration_policy_handler.h"
#include <algorithm>
+#include <cstring>
#include <string>
#include "base/files/file_path.h"
@@ -292,6 +293,8 @@ bool StringToIntEnumListPolicyHandler::CheckPolicySettings(
void StringToIntEnumListPolicyHandler::ApplyPolicySettings(
const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!strlen(pref_path_))
Mattias Nissler (ping if slow) 2013/06/12 13:55:16 Why not test for NULL?
bartfab (slow) 2013/06/12 18:57:49 Done.
+ 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 +363,8 @@ IntRangePolicyHandler::~IntRangePolicyHandler() {
void IntRangePolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!strlen(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 +391,8 @@ IntPercentageToDoublePolicyHandler::~IntPercentageToDoublePolicyHandler() {
void IntPercentageToDoublePolicyHandler::ApplyPolicySettings(
const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!strlen(pref_path_))
+ return;
const base::Value* value = policies.GetValue(policy_name());
int percentage;
if (value && EnsureInRange(value, &percentage, NULL)) {
@@ -616,6 +623,8 @@ bool ExtensionURLPatternListPolicyHandler::CheckPolicySettings(
void ExtensionURLPatternListPolicyHandler::ApplyPolicySettings(
const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!strlen(pref_path_))
+ return;
const Value* value = policies.GetValue(policy_name());
if (value)
prefs->SetValue(pref_path_, value->DeepCopy());
@@ -636,6 +645,8 @@ SimplePolicyHandler::~SimplePolicyHandler() {
void SimplePolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
PrefValueMap* prefs) {
+ if (!strlen(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