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/options/vpn_config_view.h" | 5 #include "chrome/browser/chromeos/options/vpn_config_view.h" |
6 | 6 |
7 #include "ash/system/chromeos/network/network_connect.h" | 7 #include "ash/system/chromeos/network/network_connect.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 properties->SetStringWithoutPathExpansion( | 827 properties->SetStringWithoutPathExpansion( |
828 shill::kL2tpIpsecUserProperty, user_name); | 828 shill::kL2tpIpsecUserProperty, user_name); |
829 } | 829 } |
830 if (!user_passphrase.empty()) { | 830 if (!user_passphrase.empty()) { |
831 properties->SetStringWithoutPathExpansion( | 831 properties->SetStringWithoutPathExpansion( |
832 shill::kL2tpIpsecPasswordProperty, user_passphrase); | 832 shill::kL2tpIpsecPasswordProperty, user_passphrase); |
833 } | 833 } |
834 break; | 834 break; |
835 } | 835 } |
836 case PROVIDER_TYPE_INDEX_L2TP_IPSEC_USER_CERT: { | 836 case PROVIDER_TYPE_INDEX_L2TP_IPSEC_USER_CERT: { |
837 std::string ca_cert_pem = GetServerCACertPEM(); | 837 if (server_ca_cert_combobox_) { |
838 base::ListValue* pem_list = new base::ListValue; | 838 std::string ca_cert_pem = GetServerCACertPEM(); |
839 if (!ca_cert_pem.empty()) | 839 base::ListValue* pem_list = new base::ListValue; |
840 pem_list->AppendString(ca_cert_pem); | 840 if (!ca_cert_pem.empty()) |
841 properties->SetWithoutPathExpansion(shill::kL2tpIpsecCaCertPemProperty, | 841 pem_list->AppendString(ca_cert_pem); |
842 pem_list); | 842 properties->SetWithoutPathExpansion(shill::kL2tpIpsecCaCertPemProperty, |
| 843 pem_list); |
| 844 } |
843 SetUserCertProperties(client_cert::CONFIG_TYPE_IPSEC, properties); | 845 SetUserCertProperties(client_cert::CONFIG_TYPE_IPSEC, properties); |
844 if (!group_name.empty()) { | 846 if (!group_name.empty()) { |
845 properties->SetStringWithoutPathExpansion( | 847 properties->SetStringWithoutPathExpansion( |
846 shill::kL2tpIpsecTunnelGroupProperty, GetGroupName()); | 848 shill::kL2tpIpsecTunnelGroupProperty, GetGroupName()); |
847 } | 849 } |
848 if (!user_name.empty()) { | 850 if (!user_name.empty()) { |
849 properties->SetStringWithoutPathExpansion( | 851 properties->SetStringWithoutPathExpansion( |
850 shill::kL2tpIpsecUserProperty, user_name); | 852 shill::kL2tpIpsecUserProperty, user_name); |
851 } | 853 } |
852 if (!user_passphrase.empty()) { | 854 if (!user_passphrase.empty()) { |
853 properties->SetStringWithoutPathExpansion( | 855 properties->SetStringWithoutPathExpansion( |
854 shill::kL2tpIpsecPasswordProperty, user_passphrase); | 856 shill::kL2tpIpsecPasswordProperty, user_passphrase); |
855 } | 857 } |
856 break; | 858 break; |
857 } | 859 } |
858 case PROVIDER_TYPE_INDEX_OPEN_VPN: { | 860 case PROVIDER_TYPE_INDEX_OPEN_VPN: { |
859 std::string ca_cert_pem = GetServerCACertPEM(); | 861 if (server_ca_cert_combobox_) { |
860 base::ListValue* pem_list = new base::ListValue; | 862 std::string ca_cert_pem = GetServerCACertPEM(); |
861 if (!ca_cert_pem.empty()) | 863 base::ListValue* pem_list = new base::ListValue; |
862 pem_list->AppendString(ca_cert_pem); | 864 if (!ca_cert_pem.empty()) |
863 properties->SetWithoutPathExpansion(shill::kOpenVPNCaCertPemProperty, | 865 pem_list->AppendString(ca_cert_pem); |
864 pem_list); | 866 properties->SetWithoutPathExpansion(shill::kOpenVPNCaCertPemProperty, |
| 867 pem_list); |
| 868 } |
865 SetUserCertProperties(client_cert::CONFIG_TYPE_OPENVPN, properties); | 869 SetUserCertProperties(client_cert::CONFIG_TYPE_OPENVPN, properties); |
866 properties->SetStringWithoutPathExpansion( | 870 properties->SetStringWithoutPathExpansion( |
867 shill::kOpenVPNUserProperty, GetUsername()); | 871 shill::kOpenVPNUserProperty, GetUsername()); |
868 if (!user_passphrase.empty()) { | 872 if (!user_passphrase.empty()) { |
869 properties->SetStringWithoutPathExpansion( | 873 properties->SetStringWithoutPathExpansion( |
870 shill::kOpenVPNPasswordProperty, user_passphrase); | 874 shill::kOpenVPNPasswordProperty, user_passphrase); |
871 } | 875 } |
872 std::string otp = GetOTP(); | 876 std::string otp = GetOTP(); |
873 if (!otp.empty()) { | 877 if (!otp.empty()) { |
874 properties->SetStringWithoutPathExpansion( | 878 properties->SetStringWithoutPathExpansion( |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 property_ui_data->ParseOncProperty( | 1064 property_ui_data->ParseOncProperty( |
1061 onc_source, | 1065 onc_source, |
1062 onc, | 1066 onc, |
1063 base::StringPrintf("%s.%s.%s", | 1067 base::StringPrintf("%s.%s.%s", |
1064 ::onc::network_config::kVPN, | 1068 ::onc::network_config::kVPN, |
1065 dict_key.c_str(), | 1069 dict_key.c_str(), |
1066 key.c_str())); | 1070 key.c_str())); |
1067 } | 1071 } |
1068 | 1072 |
1069 } // namespace chromeos | 1073 } // namespace chromeos |
OLD | NEW |