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

Unified Diff: components/policy/core/browser/url_blacklist_policy_handler.cc

Issue 2149253003: Switch various ValueTypeToString()s to base::Value::GetTypeName(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@value
Patch Set: rebase Created 4 years, 5 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 | « components/policy/core/browser/proxy_policy_handler.cc ('k') | components/prefs/pref_value_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
}
« no previous file with comments | « components/policy/core/browser/proxy_policy_handler.cc ('k') | components/prefs/pref_value_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698