Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Side by Side Diff: chromeos/network/onc/onc_merger.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/network/onc/onc_mapper.cc ('k') | chromeos/network/onc/onc_signature.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_mapper.cc ('k') | chromeos/network/onc/onc_signature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698