OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/policy/core/common/registry_dict.h" | 5 #include "components/policy/core/common/registry_dict.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 ConvertValue(entry.value(), schema.GetProperty(entry.key())); | 55 ConvertValue(entry.value(), schema.GetProperty(entry.key())); |
56 if (converted) | 56 if (converted) |
57 result->SetWithoutPathExpansion(entry.key(), converted.release()); | 57 result->SetWithoutPathExpansion(entry.key(), converted.release()); |
58 } | 58 } |
59 return std::move(result); | 59 return std::move(result); |
60 } else if (value.GetAsList(&list)) { | 60 } else if (value.GetAsList(&list)) { |
61 std::unique_ptr<base::ListValue> result(new base::ListValue()); | 61 std::unique_ptr<base::ListValue> result(new base::ListValue()); |
62 for (base::ListValue::const_iterator entry(list->begin()); | 62 for (base::ListValue::const_iterator entry(list->begin()); |
63 entry != list->end(); ++entry) { | 63 entry != list->end(); ++entry) { |
64 std::unique_ptr<base::Value> converted = | 64 std::unique_ptr<base::Value> converted = |
65 ConvertValue(**entry, schema.GetItems()); | 65 ConvertValue(*entry, schema.GetItems()); |
66 if (converted) | 66 if (converted) |
67 result->Append(std::move(converted)); | 67 result->Append(std::move(converted)); |
68 } | 68 } |
69 return std::move(result); | 69 return std::move(result); |
70 } | 70 } |
71 return value.CreateDeepCopy(); | 71 return value.CreateDeepCopy(); |
72 } | 72 } |
73 | 73 |
74 // Else, do some conversions to map windows registry data types to JSON types. | 74 // Else, do some conversions to map windows registry data types to JSON types. |
75 std::string string_value; | 75 std::string string_value; |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 return std::move(result); | 352 return std::move(result); |
353 } | 353 } |
354 default: | 354 default: |
355 LOG(WARNING) << "Can't convert registry key to schema type " << type; | 355 LOG(WARNING) << "Can't convert registry key to schema type " << type; |
356 } | 356 } |
357 | 357 |
358 return nullptr; | 358 return nullptr; |
359 } | 359 } |
360 #endif // #if defined(OS_WIN) | 360 #endif // #if defined(OS_WIN) |
361 } // namespace policy | 361 } // namespace policy |
OLD | NEW |