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