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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // |policy|. | 49 // |policy|. |
50 void MarkRecommendedFieldnames(const base::DictionaryValue& policy, | 50 void MarkRecommendedFieldnames(const base::DictionaryValue& policy, |
51 base::DictionaryValue* result) { | 51 base::DictionaryValue* result) { |
52 const base::ListValue* recommended_value = NULL; | 52 const base::ListValue* recommended_value = NULL; |
53 if (!policy.GetListWithoutPathExpansion(::onc::kRecommended, | 53 if (!policy.GetListWithoutPathExpansion(::onc::kRecommended, |
54 &recommended_value)) | 54 &recommended_value)) |
55 return; | 55 return; |
56 for (base::ListValue::const_iterator it = recommended_value->begin(); | 56 for (base::ListValue::const_iterator it = recommended_value->begin(); |
57 it != recommended_value->end(); ++it) { | 57 it != recommended_value->end(); ++it) { |
58 std::string entry; | 58 std::string entry; |
59 if ((*it)->GetAsString(&entry)) | 59 if (it->GetAsString(&entry)) |
60 result->SetBooleanWithoutPathExpansion(entry, true); | 60 result->SetBooleanWithoutPathExpansion(entry, true); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 // Returns a dictionary which contains |true| at each path that is editable by | 64 // Returns a dictionary which contains |true| at each path that is editable by |
65 // the user. No other fields are set. | 65 // the user. No other fields are set. |
66 DictionaryPtr GetEditableFlags(const base::DictionaryValue& policy) { | 66 DictionaryPtr GetEditableFlags(const base::DictionaryValue& policy) { |
67 DictionaryPtr result_editable(new base::DictionaryValue); | 67 DictionaryPtr result_editable(new base::DictionaryValue); |
68 MarkRecommendedFieldnames(policy, result_editable.get()); | 68 MarkRecommendedFieldnames(policy, result_editable.get()); |
69 | 69 |
(...skipping 436 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 |