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

Unified Diff: chrome/tools/build/generate_policy_source.py

Issue 17034006: Add base namespace to more values in sync and elsewhere. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « chrome/installer/util/master_preferences.cc ('k') | chromeos/dbus/shill_ipconfig_client_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/build/generate_policy_source.py
diff --git a/chrome/tools/build/generate_policy_source.py b/chrome/tools/build/generate_policy_source.py
index 085b8744373ff8269c199b38173379c1380a269c..d387b82bad3719dd20f66fbb080f4e9365f1d1bd 100755
--- a/chrome/tools/build/generate_policy_source.py
+++ b/chrome/tools/build/generate_policy_source.py
@@ -244,7 +244,7 @@ def _WritePolicyConstantSource(policies, os, f):
f.write('const PolicyDefinitionList::Entry kEntries[] = {\n')
for policy in policies:
if policy.is_supported:
- f.write(' { key::k%s, Value::%s, %s, %s },\n' %
+ f.write(' { key::k%s, base::Value::%s, %s, %s },\n' %
(policy.name, policy.value_type,
'true' if policy.is_device_only else 'false', policy.id))
f.write('};\n\n')
@@ -424,7 +424,7 @@ namespace policy {
namespace em = enterprise_management;
-Value* DecodeIntegerValue(google::protobuf::int64 value) {
+base::Value* DecodeIntegerValue(google::protobuf::int64 value) {
if (value < std::numeric_limits<int>::min() ||
value > std::numeric_limits<int>::max()) {
LOG(WARNING) << "Integer value " << value
@@ -432,15 +432,15 @@ Value* DecodeIntegerValue(google::protobuf::int64 value) {
return NULL;
}
- return Value::CreateIntegerValue(static_cast<int>(value));
+ return base::Value::CreateIntegerValue(static_cast<int>(value));
}
-ListValue* DecodeStringList(const em::StringList& string_list) {
- ListValue* list_value = new ListValue;
+base::ListValue* DecodeStringList(const em::StringList& string_list) {
+ base::ListValue* list_value = new base::ListValue;
RepeatedPtrField<std::string>::const_iterator entry;
for (entry = string_list.entries().begin();
entry != string_list.entries().end(); ++entry) {
- list_value->Append(Value::CreateStringValue(*entry));
+ list_value->Append(base::Value::CreateStringValue(*entry));
}
return list_value;
}
@@ -457,16 +457,16 @@ CPP_FOOT = '''}
def _CreateValue(type, arg):
if type == 'TYPE_BOOLEAN':
- return 'Value::CreateBooleanValue(%s)' % arg
+ return 'base::Value::CreateBooleanValue(%s)' % arg
elif type == 'TYPE_INTEGER':
return 'DecodeIntegerValue(%s)' % arg
elif type == 'TYPE_STRING':
- return 'Value::CreateStringValue(%s)' % arg
+ return 'base::Value::CreateStringValue(%s)' % arg
elif type == 'TYPE_LIST':
return 'DecodeStringList(%s)' % arg
elif type == 'TYPE_DICTIONARY':
# TODO(joaodasilva): decode 'dict' types. http://crbug.com/108997
- return 'new DictionaryValue()'
+ return 'new base::DictionaryValue()'
else:
raise NotImplementedError('Unknown type %s' % type)
@@ -496,7 +496,7 @@ def _WritePolicyCode(f, policy):
' }\n'
' }\n'
' if (do_set) {\n')
- f.write(' Value* value = %s;\n' %
+ f.write(' base::Value* value = %s;\n' %
(_CreateValue(policy.value_type, 'policy_proto.value()')))
f.write(' map->Set(key::k%s, level, POLICY_SCOPE_USER, value);\n' %
policy.name)
« no previous file with comments | « chrome/installer/util/master_preferences.cc ('k') | chromeos/dbus/shill_ipconfig_client_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698