OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/policy/user_policy_cache.h" | 5 #include "chrome/browser/policy/user_policy_cache.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 if (value.has_string_value()) | 194 if (value.has_string_value()) |
195 return Value::CreateStringValue(value.string_value()); | 195 return Value::CreateStringValue(value.string_value()); |
196 return NULL; | 196 return NULL; |
197 case em::GenericValue::VALUE_TYPE_DOUBLE: | 197 case em::GenericValue::VALUE_TYPE_DOUBLE: |
198 if (value.has_double_value()) | 198 if (value.has_double_value()) |
199 return Value::CreateDoubleValue(value.double_value()); | 199 return Value::CreateDoubleValue(value.double_value()); |
200 return NULL; | 200 return NULL; |
201 case em::GenericValue::VALUE_TYPE_BYTES: | 201 case em::GenericValue::VALUE_TYPE_BYTES: |
202 if (value.has_bytes_value()) { | 202 if (value.has_bytes_value()) { |
203 std::string bytes = value.bytes_value(); | 203 std::string bytes = value.bytes_value(); |
204 return BinaryValue::CreateWithCopiedBuffer(bytes.c_str(), bytes.size()); | 204 return base::BinaryValue::CreateWithCopiedBuffer(bytes.c_str(), |
| 205 bytes.size()); |
205 } | 206 } |
206 return NULL; | 207 return NULL; |
207 case em::GenericValue::VALUE_TYPE_BOOL_ARRAY: { | 208 case em::GenericValue::VALUE_TYPE_BOOL_ARRAY: { |
208 ListValue* list = new ListValue; | 209 ListValue* list = new ListValue; |
209 RepeatedField<bool>::const_iterator i; | 210 RepeatedField<bool>::const_iterator i; |
210 for (i = value.bool_array().begin(); i != value.bool_array().end(); ++i) | 211 for (i = value.bool_array().begin(); i != value.bool_array().end(); ++i) |
211 list->Append(Value::CreateBooleanValue(*i)); | 212 list->Append(Value::CreateBooleanValue(*i)); |
212 return list; | 213 return list; |
213 } | 214 } |
214 case em::GenericValue::VALUE_TYPE_INT64_ARRAY: { | 215 case em::GenericValue::VALUE_TYPE_INT64_ARRAY: { |
(...skipping 24 matching lines...) Expand all Loading... |
239 return list; | 240 return list; |
240 } | 241 } |
241 default: | 242 default: |
242 NOTREACHED() << "Unhandled value type"; | 243 NOTREACHED() << "Unhandled value type"; |
243 } | 244 } |
244 | 245 |
245 return NULL; | 246 return NULL; |
246 } | 247 } |
247 | 248 |
248 } // namespace policy | 249 } // namespace policy |
OLD | NEW |