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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
375 } | 375 } |
376 | 376 |
377 // 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 |
378 // controlled by policy. | 378 // controlled by policy. |
379 std::string which_effective; | 379 std::string which_effective; |
380 scoped_ptr<base::Value> effective_value = | 380 scoped_ptr<base::Value> effective_value = |
381 MergeToEffective::MergeValues(key, values, &which_effective); | 381 MergeToEffective::MergeValues(key, values, &which_effective); |
382 | 382 |
383 if (IsIdentifierField(*signature_, key)) { | 383 if (IsIdentifierField(*signature_, key)) { |
384 // Don't augment the GUID but write the plain value. | 384 // Don't augment the GUID but write the plain value. |
385 if (!effective_value) { | 385 if (!effective_value) { |
pneubeck (no reviews)
2015/01/14 17:47:10
please simplify/flatten the logic here:
if (effe
stevenjb
2015/01/14 18:07:44
Done (without the else's)
pneubeck (no reviews)
2015/01/15 09:45:12
i think you didn't upload the latest patch set.
| |
386 LOG(ERROR) << "GUID field has no effective value"; | 386 if (values.active_setting) { |
387 return nullptr; | 387 // Unmanaged networks have assigned (active) GUID values. |
388 effective_value.reset(values.active_setting->DeepCopy()); | |
389 } else { | |
390 LOG(ERROR) << "GUID field has no effective value"; | |
391 return nullptr; | |
392 } | |
388 } | 393 } |
389 | 394 |
390 // DCHECK that all provided GUIDs are identical. | 395 // DCHECK that all provided GUIDs are identical. |
391 DCHECK(AllPresentValuesEqual(values, *effective_value)); | 396 DCHECK(AllPresentValuesEqual(values, *effective_value)); |
392 | 397 |
393 // Return the un-augmented GUID. | 398 // Return the un-augmented GUID. |
394 return effective_value.Pass(); | 399 return effective_value.Pass(); |
395 } | 400 } |
396 | 401 |
397 scoped_ptr<base::DictionaryValue> augmented_value( | 402 scoped_ptr<base::DictionaryValue> augmented_value( |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 const base::DictionaryValue* shared_settings, | 496 const base::DictionaryValue* shared_settings, |
492 const base::DictionaryValue* active_settings) { | 497 const base::DictionaryValue* active_settings) { |
493 MergeToAugmented merger; | 498 MergeToAugmented merger; |
494 return merger.MergeDictionaries( | 499 return merger.MergeDictionaries( |
495 signature, user_policy, device_policy, user_settings, shared_settings, | 500 signature, user_policy, device_policy, user_settings, shared_settings, |
496 active_settings); | 501 active_settings); |
497 } | 502 } |
498 | 503 |
499 } // namespace onc | 504 } // namespace onc |
500 } // namespace chromeos | 505 } // namespace chromeos |
OLD | NEW |