OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "tools/json_schema_compiler/util.h" | 5 #include "tools/json_schema_compiler/util.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 | 8 |
9 namespace json_schema_compiler { | 9 namespace json_schema_compiler { |
10 namespace util { | 10 namespace util { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void AddItemToList(const linked_ptr<base::Value>& from, | 63 void AddItemToList(const linked_ptr<base::Value>& from, |
64 base::ListValue* out) { | 64 base::ListValue* out) { |
65 out->Append(from->DeepCopy()); | 65 out->Append(from->DeepCopy()); |
66 } | 66 } |
67 | 67 |
68 void AddItemToList(const linked_ptr<base::DictionaryValue>& from, | 68 void AddItemToList(const linked_ptr<base::DictionaryValue>& from, |
69 base::ListValue* out) { | 69 base::ListValue* out) { |
70 out->Append(static_cast<base::Value*>(from->DeepCopy())); | 70 out->Append(static_cast<base::Value*>(from->DeepCopy())); |
71 } | 71 } |
72 | 72 |
73 std::string ValueTypeToString(Value::Type type) { | 73 std::string ValueTypeToString(base::Value::Type type) { |
74 switch(type) { | 74 switch(type) { |
75 case Value::TYPE_NULL: | 75 case base::Value::TYPE_NULL: |
76 return "null"; | 76 return "null"; |
77 case Value::TYPE_BOOLEAN: | 77 case base::Value::TYPE_BOOLEAN: |
78 return "boolean"; | 78 return "boolean"; |
79 case Value::TYPE_INTEGER: | 79 case base::Value::TYPE_INTEGER: |
80 return "integer"; | 80 return "integer"; |
81 case Value::TYPE_DOUBLE: | 81 case base::Value::TYPE_DOUBLE: |
82 return "number"; | 82 return "number"; |
83 case Value::TYPE_STRING: | 83 case base::Value::TYPE_STRING: |
84 return "string"; | 84 return "string"; |
85 case Value::TYPE_BINARY: | 85 case base::Value::TYPE_BINARY: |
86 return "binary"; | 86 return "binary"; |
87 case Value::TYPE_DICTIONARY: | 87 case base::Value::TYPE_DICTIONARY: |
88 return "dictionary"; | 88 return "dictionary"; |
89 case Value::TYPE_LIST: | 89 case base::Value::TYPE_LIST: |
90 return "list"; | 90 return "list"; |
91 } | 91 } |
92 NOTREACHED(); | 92 NOTREACHED(); |
93 return ""; | 93 return ""; |
94 } | 94 } |
95 | 95 |
96 } // namespace api_util | 96 } // namespace api_util |
97 } // namespace extensions | 97 } // namespace extensions |
OLD | NEW |