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

Unified Diff: components/policy/core/common/policy_test_utils.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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: components/policy/core/common/policy_test_utils.cc
diff --git a/components/policy/core/common/policy_test_utils.cc b/components/policy/core/common/policy_test_utils.cc
index c0860ef1c8e7830ff70826feaa516f5949a3cf50..7f4e597376bcea8ed06b754db0ddfd7c7f89e5b5 100644
--- a/components/policy/core/common/policy_test_utils.cc
+++ b/components/policy/core/common/policy_test_utils.cc
@@ -57,17 +57,17 @@ bool PolicyServiceIsEmpty(const PolicyService* service) {
#if defined(OS_IOS) || defined(OS_MACOSX)
CFPropertyListRef ValueToProperty(const base::Value& value) {
switch (value.GetType()) {
- case base::Value::TYPE_NULL:
+ case base::Value::Type::NONE:
return kCFNull;
- case base::Value::TYPE_BOOLEAN: {
+ case base::Value::Type::BOOLEAN: {
bool bool_value;
if (value.GetAsBoolean(&bool_value))
return bool_value ? kCFBooleanTrue : kCFBooleanFalse;
break;
}
- case base::Value::TYPE_INTEGER: {
+ case base::Value::Type::INTEGER: {
int int_value;
if (value.GetAsInteger(&int_value)) {
return CFNumberCreate(
@@ -76,7 +76,7 @@ CFPropertyListRef ValueToProperty(const base::Value& value) {
break;
}
- case base::Value::TYPE_DOUBLE: {
+ case base::Value::Type::DOUBLE: {
double double_value;
if (value.GetAsDouble(&double_value)) {
return CFNumberCreate(
@@ -85,14 +85,14 @@ CFPropertyListRef ValueToProperty(const base::Value& value) {
break;
}
- case base::Value::TYPE_STRING: {
+ case base::Value::Type::STRING: {
std::string string_value;
if (value.GetAsString(&string_value))
return base::SysUTF8ToCFStringRef(string_value);
break;
}
- case base::Value::TYPE_DICTIONARY: {
+ case base::Value::Type::DICTIONARY: {
const base::DictionaryValue* dict_value;
if (value.GetAsDictionary(&dict_value)) {
// |dict| is owned by the caller.
@@ -117,7 +117,7 @@ CFPropertyListRef ValueToProperty(const base::Value& value) {
break;
}
- case base::Value::TYPE_LIST: {
+ case base::Value::Type::LIST: {
const base::ListValue* list;
if (value.GetAsList(&list)) {
CFMutableArrayRef array =
@@ -135,7 +135,7 @@ CFPropertyListRef ValueToProperty(const base::Value& value) {
break;
}
- case base::Value::TYPE_BINARY:
+ case base::Value::Type::BINARY:
// This type isn't converted (though it can be represented as CFData)
// because there's no equivalent JSON type, and policy values can only
// take valid JSON values.
« no previous file with comments | « components/policy/core/common/policy_loader_win_unittest.cc ('k') | components/policy/core/common/registry_dict.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698