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/wifi_config_view.h" | 5 #include "chrome/browser/chromeos/options/wifi_config_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | |
10 | |
11 #include "base/bind.h" | 9 #include "base/bind.h" |
12 #include "base/macros.h" | 10 #include "base/macros.h" |
13 #include "base/memory/ptr_util.h" | |
14 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
16 #include "chrome/browser/chromeos/enrollment_dialog_view.h" | 13 #include "chrome/browser/chromeos/enrollment_dialog_view.h" |
17 #include "chrome/browser/chromeos/net/shill_error.h" | 14 #include "chrome/browser/chromeos/net/shill_error.h" |
18 #include "chrome/browser/chromeos/options/passphrase_textfield.h" | 15 #include "chrome/browser/chromeos/options/passphrase_textfield.h" |
19 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
20 #include "chrome/browser/ui/views/harmony/layout_delegate.h" | 17 #include "chrome/browser/ui/views/harmony/layout_delegate.h" |
21 #include "chrome/grit/generated_resources.h" | 18 #include "chrome/grit/generated_resources.h" |
22 #include "chrome/grit/theme_resources.h" | 19 #include "chrome/grit/theme_resources.h" |
23 #include "chromeos/login/login_state.h" | 20 #include "chromeos/login/login_state.h" |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 shill::kEapSubjectMatchProperty, GetEapSubjectMatch()); | 882 shill::kEapSubjectMatchProperty, GetEapSubjectMatch()); |
886 | 883 |
887 SetEapClientCertProperties(properties); | 884 SetEapClientCertProperties(properties); |
888 | 885 |
889 properties->SetBooleanWithoutPathExpansion( | 886 properties->SetBooleanWithoutPathExpansion( |
890 shill::kEapUseSystemCasProperty, GetEapUseSystemCas()); | 887 shill::kEapUseSystemCasProperty, GetEapUseSystemCas()); |
891 if (!configured || passphrase_textfield_->changed()) { | 888 if (!configured || passphrase_textfield_->changed()) { |
892 properties->SetStringWithoutPathExpansion( | 889 properties->SetStringWithoutPathExpansion( |
893 shill::kEapPasswordProperty, GetPassphrase()); | 890 shill::kEapPasswordProperty, GetPassphrase()); |
894 } | 891 } |
895 auto pem_list = base::MakeUnique<base::ListValue>(); | 892 base::ListValue* pem_list = new base::ListValue; |
896 std::string ca_cert_pem = GetEapServerCaCertPEM(); | 893 std::string ca_cert_pem = GetEapServerCaCertPEM(); |
897 if (!ca_cert_pem.empty()) | 894 if (!ca_cert_pem.empty()) |
898 pem_list->AppendString(ca_cert_pem); | 895 pem_list->AppendString(ca_cert_pem); |
899 properties->SetWithoutPathExpansion(shill::kEapCaCertPemProperty, | 896 properties->SetWithoutPathExpansion( |
900 std::move(pem_list)); | 897 shill::kEapCaCertPemProperty, pem_list); |
901 } | 898 } |
902 | 899 |
903 void WifiConfigView::Cancel() { | 900 void WifiConfigView::Cancel() { |
904 } | 901 } |
905 | 902 |
906 void WifiConfigView::Init(bool show_8021x) { | 903 void WifiConfigView::Init(bool show_8021x) { |
907 const NetworkState* network = GetNetworkState(); | 904 const NetworkState* network = GetNetworkState(); |
908 if (network) { | 905 if (network) { |
909 if (network->type() == shill::kTypeWifi) { | 906 if (network->type() == shill::kTypeWifi) { |
910 if (network->security_class() == shill::kSecurity8021x || | 907 if (network->security_class() == shill::kSecurity8021x || |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1490 void WifiConfigView::ParseEAPUIProperty(NetworkPropertyUIData* property_ui_data, | 1487 void WifiConfigView::ParseEAPUIProperty(NetworkPropertyUIData* property_ui_data, |
1491 const NetworkState* network, | 1488 const NetworkState* network, |
1492 const std::string& key) { | 1489 const std::string& key) { |
1493 std::string onc_tag = network->type() == shill::kTypeEthernet | 1490 std::string onc_tag = network->type() == shill::kTypeEthernet |
1494 ? ::onc::ethernet::kEAP | 1491 ? ::onc::ethernet::kEAP |
1495 : ::onc::wifi::kEAP; | 1492 : ::onc::wifi::kEAP; |
1496 ParseUIProperty(property_ui_data, network, onc_tag + '.' + key); | 1493 ParseUIProperty(property_ui_data, network, onc_tag + '.' + key); |
1497 } | 1494 } |
1498 | 1495 |
1499 } // namespace chromeos | 1496 } // namespace chromeos |
OLD | NEW |