| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 const std::string& key, | 362 const std::string& key, |
| 363 const ValueParams& values) override { | 363 const ValueParams& values) override { |
| 364 const OncFieldSignature* field = NULL; | 364 const OncFieldSignature* field = NULL; |
| 365 if (signature_) | 365 if (signature_) |
| 366 field = GetFieldSignature(*signature_, key); | 366 field = GetFieldSignature(*signature_, key); |
| 367 | 367 |
| 368 if (!field) { | 368 if (!field) { |
| 369 // This field is not part of the provided ONCSignature, thus it cannot be | 369 // This field is not part of the provided ONCSignature, thus it cannot be |
| 370 // controlled by policy. Return the plain active value instead of an | 370 // controlled by policy. Return the plain active value instead of an |
| 371 // augmented dictionary. | 371 // augmented dictionary. |
| 372 return make_scoped_ptr(values.active_setting->DeepCopy()); | 372 if (values.active_setting) |
| 373 return make_scoped_ptr(values.active_setting->DeepCopy()); |
| 374 return nullptr; |
| 373 } | 375 } |
| 374 | 376 |
| 375 // This field is part of the provided ONCSignature, thus it can be | 377 // This field is part of the provided ONCSignature, thus it can be |
| 376 // controlled by policy. | 378 // controlled by policy. |
| 377 std::string which_effective; | 379 std::string which_effective; |
| 378 scoped_ptr<base::Value> effective_value = | 380 scoped_ptr<base::Value> effective_value = |
| 379 MergeToEffective::MergeValues(key, values, &which_effective); | 381 MergeToEffective::MergeValues(key, values, &which_effective); |
| 380 | 382 |
| 381 if (IsIdentifierField(*signature_, key)) { | 383 if (IsIdentifierField(*signature_, key)) { |
| 382 // Don't augment the GUID but write the plain value. | 384 // Don't augment the GUID but write the plain value. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 const base::DictionaryValue* shared_settings, | 491 const base::DictionaryValue* shared_settings, |
| 490 const base::DictionaryValue* active_settings) { | 492 const base::DictionaryValue* active_settings) { |
| 491 MergeToAugmented merger; | 493 MergeToAugmented merger; |
| 492 return merger.MergeDictionaries( | 494 return merger.MergeDictionaries( |
| 493 signature, user_policy, device_policy, user_settings, shared_settings, | 495 signature, user_policy, device_policy, user_settings, shared_settings, |
| 494 active_settings); | 496 active_settings); |
| 495 } | 497 } |
| 496 | 498 |
| 497 } // namespace onc | 499 } // namespace onc |
| 498 } // namespace chromeos | 500 } // namespace chromeos |
| OLD | NEW |