Index: components/policy/core/browser/url_blacklist_policy_handler.cc |
diff --git a/components/policy/core/browser/url_blacklist_policy_handler.cc b/components/policy/core/browser/url_blacklist_policy_handler.cc |
index 80deab632dd9c706b33295faed8737f07e42357a..2087f9617f66aa13347b1d2b420c9cb65ca1ae01 100644 |
--- a/components/policy/core/browser/url_blacklist_policy_handler.cc |
+++ b/components/policy/core/browser/url_blacklist_policy_handler.cc |
@@ -28,15 +28,13 @@ bool URLBlacklistPolicyHandler::CheckPolicySettings(const PolicyMap& policies, |
const base::Value* url_blacklist = policies.GetValue(key::kURLBlacklist); |
if (disabled_schemes && !disabled_schemes->IsType(base::Value::TYPE_LIST)) { |
- errors->AddError(key::kDisabledSchemes, |
- IDS_POLICY_TYPE_ERROR, |
- ValueTypeToString(base::Value::TYPE_LIST)); |
+ errors->AddError(key::kDisabledSchemes, IDS_POLICY_TYPE_ERROR, |
+ base::Value::GetTypeName(base::Value::TYPE_LIST)); |
} |
if (url_blacklist && !url_blacklist->IsType(base::Value::TYPE_LIST)) { |
- errors->AddError(key::kURLBlacklist, |
- IDS_POLICY_TYPE_ERROR, |
- ValueTypeToString(base::Value::TYPE_LIST)); |
+ errors->AddError(key::kURLBlacklist, IDS_POLICY_TYPE_ERROR, |
+ base::Value::GetTypeName(base::Value::TYPE_LIST)); |
} |
return true; |
@@ -60,10 +58,9 @@ void URLBlacklistPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, |
// We start with the DisabledSchemes because we have size limit when |
// handling URLBlacklists. |
if (disabled_schemes) { |
- for (base::ListValue::const_iterator entry(disabled_schemes->begin()); |
- entry != disabled_schemes->end(); ++entry) { |
+ for (const auto& entry : *disabled_schemes) { |
std::string entry_value; |
- if ((*entry)->GetAsString(&entry_value)) { |
+ if (entry->GetAsString(&entry_value)) { |
entry_value.append("://*"); |
merged_url_blacklist->AppendString(entry_value); |
} |
@@ -71,10 +68,9 @@ void URLBlacklistPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, |
} |
if (url_blacklist) { |
- for (base::ListValue::const_iterator entry(url_blacklist->begin()); |
- entry != url_blacklist->end(); ++entry) { |
- if ((*entry)->IsType(base::Value::TYPE_STRING)) |
- merged_url_blacklist->Append((*entry)->CreateDeepCopy()); |
+ for (const auto& entry : *url_blacklist) { |
+ if (entry->IsType(base::Value::TYPE_STRING)) |
+ merged_url_blacklist->Append(entry->CreateDeepCopy()); |
} |
} |