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 "chromeos/network/onc/onc_merger.h" | 5 #include "chromeos/network/onc/onc_merger.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 if (!*it_outer) | 107 if (!*it_outer) |
108 continue; | 108 continue; |
109 | 109 |
110 for (base::DictionaryValue::Iterator field(**it_outer); !field.IsAtEnd(); | 110 for (base::DictionaryValue::Iterator field(**it_outer); !field.IsAtEnd(); |
111 field.Advance()) { | 111 field.Advance()) { |
112 const std::string& key = field.key(); | 112 const std::string& key = field.key(); |
113 if (key == ::onc::kRecommended || !visited.insert(key).second) | 113 if (key == ::onc::kRecommended || !visited.insert(key).second) |
114 continue; | 114 continue; |
115 | 115 |
116 std::unique_ptr<base::Value> merged_value; | 116 std::unique_ptr<base::Value> merged_value; |
117 if (field.value().IsType(base::Value::TYPE_DICTIONARY)) { | 117 if (field.value().IsType(base::Value::Type::DICTIONARY)) { |
118 DictPtrs nested_dicts; | 118 DictPtrs nested_dicts; |
119 for (DictPtrs::const_iterator it_inner = dicts.begin(); | 119 for (DictPtrs::const_iterator it_inner = dicts.begin(); |
120 it_inner != dicts.end(); ++it_inner) { | 120 it_inner != dicts.end(); ++it_inner) { |
121 const base::DictionaryValue* nested_dict = NULL; | 121 const base::DictionaryValue* nested_dict = NULL; |
122 if (*it_inner) | 122 if (*it_inner) |
123 (*it_inner)->GetDictionaryWithoutPathExpansion(key, &nested_dict); | 123 (*it_inner)->GetDictionaryWithoutPathExpansion(key, &nested_dict); |
124 nested_dicts.push_back(nested_dict); | 124 nested_dicts.push_back(nested_dict); |
125 } | 125 } |
126 DictionaryPtr merged_dict(MergeNestedDictionaries(key, nested_dicts)); | 126 DictionaryPtr merged_dict(MergeNestedDictionaries(key, nested_dicts)); |
127 if (!merged_dict->empty()) | 127 if (!merged_dict->empty()) |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 const base::DictionaryValue* shared_settings, | 506 const base::DictionaryValue* shared_settings, |
507 const base::DictionaryValue* active_settings) { | 507 const base::DictionaryValue* active_settings) { |
508 MergeToAugmented merger; | 508 MergeToAugmented merger; |
509 return merger.MergeDictionaries( | 509 return merger.MergeDictionaries( |
510 signature, user_policy, device_policy, user_settings, shared_settings, | 510 signature, user_policy, device_policy, user_settings, shared_settings, |
511 active_settings); | 511 active_settings); |
512 } | 512 } |
513 | 513 |
514 } // namespace onc | 514 } // namespace onc |
515 } // namespace chromeos | 515 } // namespace chromeos |
OLD | NEW |