OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/device_management_policy_cache.h" | 5 #include "chrome/browser/policy/device_management_policy_cache.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return BinaryValue::CreateWithCopiedBuffer(bytes.c_str(), bytes.size()); | 171 return BinaryValue::CreateWithCopiedBuffer(bytes.c_str(), bytes.size()); |
172 } | 172 } |
173 return NULL; | 173 return NULL; |
174 case em::GenericValue::VALUE_TYPE_BOOL_ARRAY: { | 174 case em::GenericValue::VALUE_TYPE_BOOL_ARRAY: { |
175 ListValue* list = new ListValue; | 175 ListValue* list = new ListValue; |
176 RepeatedField<bool>::const_iterator i; | 176 RepeatedField<bool>::const_iterator i; |
177 for (i = value.bool_array().begin(); i != value.bool_array().end(); ++i) | 177 for (i = value.bool_array().begin(); i != value.bool_array().end(); ++i) |
178 list->Append(Value::CreateBooleanValue(*i)); | 178 list->Append(Value::CreateBooleanValue(*i)); |
179 return list; | 179 return list; |
180 } | 180 } |
181 case em::GenericValue::VALUE_TYPE_INT64_ARRAY_: { | 181 case em::GenericValue::VALUE_TYPE_INT64_ARRAY: { |
182 ListValue* list = new ListValue; | 182 ListValue* list = new ListValue; |
183 RepeatedField<google::protobuf::int64>::const_iterator i; | 183 RepeatedField<google::protobuf::int64>::const_iterator i; |
184 for (i = value.int64_array().begin(); | 184 for (i = value.int64_array().begin(); |
185 i != value.int64_array().end(); ++i) { | 185 i != value.int64_array().end(); ++i) { |
186 Value* int_value = DecodeIntegerValue(*i); | 186 Value* int_value = DecodeIntegerValue(*i); |
187 if (int_value) | 187 if (int_value) |
188 list->Append(int_value); | 188 list->Append(int_value); |
189 } | 189 } |
190 return list; | 190 return list; |
191 } | 191 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 DeviceManagementPolicyCache::DecodeValue(named_value->value()); | 235 DeviceManagementPolicyCache::DecodeValue(named_value->value()); |
236 if (decoded_value) | 236 if (decoded_value) |
237 result->Set(named_value->name(), decoded_value); | 237 result->Set(named_value->name(), decoded_value); |
238 } | 238 } |
239 } | 239 } |
240 } | 240 } |
241 return result; | 241 return result; |
242 } | 242 } |
243 | 243 |
244 } // namespace policy | 244 } // namespace policy |
OLD | NEW |