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 "chrome/browser/chromeos/cros/onc_network_parser.h" | 5 #include "chrome/browser/chromeos/cros/onc_network_parser.h" |
6 | 6 |
7 #include <keyhi.h> | 7 #include <keyhi.h> |
8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 value.GetAsDictionary(&dict); | 614 value.GetAsDictionary(&dict); |
615 for (DictionaryValue::key_iterator iter = dict->begin_keys(); | 615 for (DictionaryValue::key_iterator iter = dict->begin_keys(); |
616 iter != dict->end_keys(); ++iter) { | 616 iter != dict->end_keys(); ++iter) { |
617 const std::string& key = *iter; | 617 const std::string& key = *iter; |
618 | 618 |
619 // Recommended keys are only of interest to the UI code and the UI reads it | 619 // Recommended keys are only of interest to the UI code and the UI reads it |
620 // directly from the ONC blob. | 620 // directly from the ONC blob. |
621 if (key == onc::kRecommended) | 621 if (key == onc::kRecommended) |
622 continue; | 622 continue; |
623 | 623 |
624 base::Value* inner_value = NULL; | 624 const base::Value* inner_value = NULL; |
625 dict->GetWithoutPathExpansion(key, &inner_value); | 625 dict->GetWithoutPathExpansion(key, &inner_value); |
626 CHECK(inner_value != NULL); | 626 CHECK(inner_value != NULL); |
627 int field_index; | 627 int field_index; |
628 for (field_index = 0; signature[field_index].field != NULL; ++field_index) { | 628 for (field_index = 0; signature[field_index].field != NULL; ++field_index) { |
629 if (key == signature[field_index].field) | 629 if (key == signature[field_index].field) |
630 break; | 630 break; |
631 } | 631 } |
632 if (signature[field_index].field == NULL) { | 632 if (signature[field_index].field == NULL) { |
633 LOG(WARNING) << network->name() << ": unexpected field: " | 633 LOG(WARNING) << network->name() << ": unexpected field: " |
634 << key << ", in type: " << onc_type; | 634 << key << ", in type: " << onc_type; |
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 // on the value of AuthenticationType. | 2011 // on the value of AuthenticationType. |
2012 { "L2TP-IPsec", PROVIDER_TYPE_L2TP_IPSEC_PSK }, | 2012 { "L2TP-IPsec", PROVIDER_TYPE_L2TP_IPSEC_PSK }, |
2013 { "OpenVPN", PROVIDER_TYPE_OPEN_VPN }, | 2013 { "OpenVPN", PROVIDER_TYPE_OPEN_VPN }, |
2014 }; | 2014 }; |
2015 CR_DEFINE_STATIC_LOCAL(EnumMapper<ProviderType>, parser, | 2015 CR_DEFINE_STATIC_LOCAL(EnumMapper<ProviderType>, parser, |
2016 (table, arraysize(table), PROVIDER_TYPE_MAX)); | 2016 (table, arraysize(table), PROVIDER_TYPE_MAX)); |
2017 return parser.Get(type); | 2017 return parser.Get(type); |
2018 } | 2018 } |
2019 | 2019 |
2020 } // namespace chromeos | 2020 } // namespace chromeos |
OLD | NEW |