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 <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 TranslateSavedOrStaticIPConfig(); | 629 TranslateSavedOrStaticIPConfig(); |
630 } | 630 } |
631 | 631 |
632 void ShillToONCTranslator::TranslateStaticIPConfig() { | 632 void ShillToONCTranslator::TranslateStaticIPConfig() { |
633 TranslateSavedOrStaticIPConfig(); | 633 TranslateSavedOrStaticIPConfig(); |
634 } | 634 } |
635 | 635 |
636 void ShillToONCTranslator::TranslateEap() { | 636 void ShillToONCTranslator::TranslateEap() { |
637 CopyPropertiesAccordingToSignature(); | 637 CopyPropertiesAccordingToSignature(); |
638 | 638 |
639 // Translate EAP Outer and Inner values. | 639 // Translate EAP Outer and Inner values if EAP.EAP exists and is not empty. |
640 TranslateWithTableAndSet(shill::kEapMethodProperty, kEAPOuterTable, | 640 std::string shill_eap; |
641 ::onc::eap::kOuter); | 641 if (shill_dictionary_->GetStringWithoutPathExpansion( |
642 TranslateWithTableAndSet(shill::kEapPhase2AuthProperty, kEAP_TTLS_InnerTable, | 642 shill::kEapMethodProperty, &shill_eap) && |
643 ::onc::eap::kInner); | 643 !shill_eap.empty()) { |
| 644 TranslateWithTableAndSet(shill::kEapMethodProperty, kEAPOuterTable, |
| 645 ::onc::eap::kOuter); |
| 646 TranslateWithTableAndSet(shill::kEapPhase2AuthProperty, |
| 647 kEAP_TTLS_InnerTable, ::onc::eap::kInner); |
| 648 } |
644 } | 649 } |
645 | 650 |
646 void ShillToONCTranslator::TranslateAndAddNestedObject( | 651 void ShillToONCTranslator::TranslateAndAddNestedObject( |
647 const std::string& onc_field_name) { | 652 const std::string& onc_field_name) { |
648 TranslateAndAddNestedObject(onc_field_name, *shill_dictionary_); | 653 TranslateAndAddNestedObject(onc_field_name, *shill_dictionary_); |
649 } | 654 } |
650 | 655 |
651 void ShillToONCTranslator::TranslateAndAddNestedObject( | 656 void ShillToONCTranslator::TranslateAndAddNestedObject( |
652 const std::string& onc_field_name, | 657 const std::string& onc_field_name, |
653 const base::DictionaryValue& dictionary) { | 658 const base::DictionaryValue& dictionary) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 const NetworkState* network_state) { | 796 const NetworkState* network_state) { |
792 CHECK(onc_signature != NULL); | 797 CHECK(onc_signature != NULL); |
793 | 798 |
794 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature, | 799 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature, |
795 network_state); | 800 network_state); |
796 return translator.CreateTranslatedONCObject(); | 801 return translator.CreateTranslatedONCObject(); |
797 } | 802 } |
798 | 803 |
799 } // namespace onc | 804 } // namespace onc |
800 } // namespace chromeos | 805 } // namespace chromeos |
OLD | NEW |