| 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_utils.h" | 5 #include "chromeos/network/onc/onc_utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 : mask_(mask) { | 346 : mask_(mask) { |
| 347 } | 347 } |
| 348 | 348 |
| 349 std::unique_ptr<base::Value> MapField( | 349 std::unique_ptr<base::Value> MapField( |
| 350 const std::string& field_name, | 350 const std::string& field_name, |
| 351 const OncValueSignature& object_signature, | 351 const OncValueSignature& object_signature, |
| 352 const base::Value& onc_value, | 352 const base::Value& onc_value, |
| 353 bool* found_unknown_field, | 353 bool* found_unknown_field, |
| 354 bool* error) override { | 354 bool* error) override { |
| 355 if (FieldIsCredential(object_signature, field_name)) { | 355 if (FieldIsCredential(object_signature, field_name)) { |
| 356 return std::unique_ptr<base::Value>(new base::StringValue(mask_)); | 356 return std::unique_ptr<base::Value>(new base::Value(mask_)); |
| 357 } else { | 357 } else { |
| 358 return Mapper::MapField(field_name, object_signature, onc_value, | 358 return Mapper::MapField(field_name, object_signature, onc_value, |
| 359 found_unknown_field, error); | 359 found_unknown_field, error); |
| 360 } | 360 } |
| 361 } | 361 } |
| 362 | 362 |
| 363 // Mask to insert in place of the sensitive values. | 363 // Mask to insert in place of the sensitive values. |
| 364 std::string mask_; | 364 std::string mask_; |
| 365 }; | 365 }; |
| 366 | 366 |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 recommended_property_key = | 783 recommended_property_key = |
| 784 property_key.substr(0, pos + 1) + ::onc::kRecommended; | 784 property_key.substr(0, pos + 1) + ::onc::kRecommended; |
| 785 } else { | 785 } else { |
| 786 // 'Name' -> 'Name', 'Recommended' | 786 // 'Name' -> 'Name', 'Recommended' |
| 787 property_basename = property_key; | 787 property_basename = property_key; |
| 788 recommended_property_key = ::onc::kRecommended; | 788 recommended_property_key = ::onc::kRecommended; |
| 789 } | 789 } |
| 790 | 790 |
| 791 const base::ListValue* recommended_keys = nullptr; | 791 const base::ListValue* recommended_keys = nullptr; |
| 792 return (onc->GetList(recommended_property_key, &recommended_keys) && | 792 return (onc->GetList(recommended_property_key, &recommended_keys) && |
| 793 recommended_keys->Find(base::StringValue(property_basename)) != | 793 recommended_keys->Find(base::Value(property_basename)) != |
| 794 recommended_keys->end()); | 794 recommended_keys->end()); |
| 795 } | 795 } |
| 796 | 796 |
| 797 namespace { | 797 namespace { |
| 798 | 798 |
| 799 const char kDirectScheme[] = "direct"; | 799 const char kDirectScheme[] = "direct"; |
| 800 const char kQuicScheme[] = "quic"; | 800 const char kQuicScheme[] = "quic"; |
| 801 const char kSocksScheme[] = "socks"; | 801 const char kSocksScheme[] = "socks"; |
| 802 const char kSocks4Scheme[] = "socks4"; | 802 const char kSocks4Scheme[] = "socks4"; |
| 803 const char kSocks5Scheme[] = "socks5"; | 803 const char kSocks5Scheme[] = "socks5"; |
| 804 | 804 |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 const PrefService* local_state_prefs, | 1319 const PrefService* local_state_prefs, |
| 1320 const NetworkState& network) { | 1320 const NetworkState& network) { |
| 1321 ::onc::ONCSource ignored_onc_source; | 1321 ::onc::ONCSource ignored_onc_source; |
| 1322 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( | 1322 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( |
| 1323 profile_prefs, local_state_prefs, network, &ignored_onc_source); | 1323 profile_prefs, local_state_prefs, network, &ignored_onc_source); |
| 1324 return policy != NULL; | 1324 return policy != NULL; |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 } // namespace onc | 1327 } // namespace onc |
| 1328 } // namespace chromeos | 1328 } // namespace chromeos |
| OLD | NEW |