Make base::Value::TYPE a scoped enum.
As mentioned in the base::Value refactor proposal, base::Value::Type should be a
C++11 style scoped enumeration. This change addresses this issue by adding the
required keyword, making the necessary substitutions and adding casts where
needed.
[email protected]
BUG=646113
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
Review-Url: https://codereview.chromium.org/2539363004
Cr-Commit-Position: refs/heads/master@{#436961}
diff --git a/chrome/browser/extensions/policy_handlers.cc b/chrome/browser/extensions/policy_handlers.cc
index b0963d6..fa80158 100644
--- a/chrome/browser/extensions/policy_handlers.cc
+++ b/chrome/browser/extensions/policy_handlers.cc
@@ -28,7 +28,7 @@
ExtensionListPolicyHandler::ExtensionListPolicyHandler(const char* policy_name,
const char* pref_path,
bool allow_wildcards)
- : policy::TypeCheckingPolicyHandler(policy_name, base::Value::TYPE_LIST),
+ : policy::TypeCheckingPolicyHandler(policy_name, base::Value::Type::LIST),
pref_path_(pref_path),
allow_wildcards_(allow_wildcards) {}
@@ -81,7 +81,7 @@
if (!(*entry)->GetAsString(&id)) {
errors->AddError(policy_name(), entry - list_value->begin(),
IDS_POLICY_TYPE_ERROR,
- base::Value::GetTypeName(base::Value::TYPE_STRING));
+ base::Value::GetTypeName(base::Value::Type::STRING));
continue;
}
if (!(allow_wildcards_ && id == "*") && !crx_file::id_util::IdIsValid(id)) {
@@ -103,7 +103,7 @@
ExtensionInstallForcelistPolicyHandler::ExtensionInstallForcelistPolicyHandler()
: policy::TypeCheckingPolicyHandler(policy::key::kExtensionInstallForcelist,
- base::Value::TYPE_LIST) {}
+ base::Value::Type::LIST) {}
ExtensionInstallForcelistPolicyHandler::
~ExtensionInstallForcelistPolicyHandler() {}
@@ -149,7 +149,7 @@
if (errors) {
errors->AddError(policy_name(), entry - policy_list_value->begin(),
IDS_POLICY_TYPE_ERROR,
- base::Value::GetTypeName(base::Value::TYPE_STRING));
+ base::Value::GetTypeName(base::Value::Type::STRING));
}
continue;
}
@@ -193,7 +193,7 @@
ExtensionURLPatternListPolicyHandler::ExtensionURLPatternListPolicyHandler(
const char* policy_name,
const char* pref_path)
- : policy::TypeCheckingPolicyHandler(policy_name, base::Value::TYPE_LIST),
+ : policy::TypeCheckingPolicyHandler(policy_name, base::Value::Type::LIST),
pref_path_(pref_path) {}
ExtensionURLPatternListPolicyHandler::~ExtensionURLPatternListPolicyHandler() {}
@@ -221,7 +221,7 @@
if (!(*entry)->GetAsString(&url_pattern_string)) {
errors->AddError(policy_name(), entry - list_value->begin(),
IDS_POLICY_TYPE_ERROR,
- base::Value::GetTypeName(base::Value::TYPE_STRING));
+ base::Value::GetTypeName(base::Value::Type::STRING));
return false;
}
@@ -272,14 +272,14 @@
// |policy_value| is expected to conform to the defined schema. But it's
// not strictly valid since there are additional restrictions.
const base::DictionaryValue* dict_value = NULL;
- DCHECK(policy_value->IsType(base::Value::TYPE_DICTIONARY));
+ DCHECK(policy_value->IsType(base::Value::Type::DICTIONARY));
policy_value->GetAsDictionary(&dict_value);
for (base::DictionaryValue::Iterator it(*dict_value); !it.IsAtEnd();
it.Advance()) {
DCHECK(it.key() == schema_constants::kWildcard ||
crx_file::id_util::IdIsValid(it.key()));
- DCHECK(it.value().IsType(base::Value::TYPE_DICTIONARY));
+ DCHECK(it.value().IsType(base::Value::Type::DICTIONARY));
// Extracts sub dictionary.
const base::DictionaryValue* sub_dict = NULL;