| 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 "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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PLEASE_INSTALL_USER_CERT); | 581 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PLEASE_INSTALL_USER_CERT); |
| 582 } | 582 } |
| 583 } else if (!IsUserCertValid()) { | 583 } else if (!IsUserCertValid()) { |
| 584 error_msg = l10n_util::GetStringUTF16( | 584 error_msg = l10n_util::GetStringUTF16( |
| 585 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_REQUIRE_HARDWARE_BACKED); | 585 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_REQUIRE_HARDWARE_BACKED); |
| 586 } | 586 } |
| 587 } | 587 } |
| 588 if (error_msg.empty() && !service_path_.empty()) { | 588 if (error_msg.empty() && !service_path_.empty()) { |
| 589 const NetworkState* network = GetNetworkState(); | 589 const NetworkState* network = GetNetworkState(); |
| 590 if (network && network->connection_state() == shill::kStateFailure) { | 590 if (network && network->connection_state() == shill::kStateFailure) { |
| 591 error_msg = ash::network_connect::ErrorString( | 591 error_msg = ash::NetworkConnect::Get()->GetErrorString( |
| 592 network->last_error(), network->path()); | 592 network->last_error(), network->path()); |
| 593 } | 593 } |
| 594 } | 594 } |
| 595 if (!error_msg.empty()) { | 595 if (!error_msg.empty()) { |
| 596 error_label_->SetText(error_msg); | 596 error_label_->SetText(error_msg); |
| 597 error_label_->SetVisible(true); | 597 error_label_->SetVisible(true); |
| 598 } else { | 598 } else { |
| 599 error_label_->SetVisible(false); | 599 error_label_->SetVisible(false); |
| 600 } | 600 } |
| 601 } | 601 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 shill::kPassphraseProperty, GetPassphrase()); | 698 shill::kPassphraseProperty, GetPassphrase()); |
| 699 } | 699 } |
| 700 } else { | 700 } else { |
| 701 security = shill::kSecurity8021x; | 701 security = shill::kSecurity8021x; |
| 702 SetEapProperties(&properties); | 702 SetEapProperties(&properties); |
| 703 } | 703 } |
| 704 properties.SetStringWithoutPathExpansion( | 704 properties.SetStringWithoutPathExpansion( |
| 705 shill::kSecurityProperty, security); | 705 shill::kSecurityProperty, security); |
| 706 | 706 |
| 707 // Configure and connect to network. | 707 // Configure and connect to network. |
| 708 ash::network_connect::CreateConfigurationAndConnect(&properties, | 708 ash::NetworkConnect::Get()->CreateConfigurationAndConnect(&properties, |
| 709 share_network); | 709 share_network); |
| 710 } else { | 710 } else { |
| 711 if (!network) { | 711 if (!network) { |
| 712 // Shill no longer knows about this network (edge case). | 712 // Shill no longer knows about this network (edge case). |
| 713 // TODO(stevenjb): Add notification for this. | 713 // TODO(stevenjb): Add notification for this. |
| 714 NET_LOG_ERROR("Network not found", service_path_); | 714 NET_LOG_ERROR("Network not found", service_path_); |
| 715 return true; // Close dialog | 715 return true; // Close dialog |
| 716 } | 716 } |
| 717 if (eap_method_combobox_) { | 717 if (eap_method_combobox_) { |
| 718 SetEapProperties(&properties); | 718 SetEapProperties(&properties); |
| 719 properties.SetBooleanWithoutPathExpansion( | 719 properties.SetBooleanWithoutPathExpansion( |
| 720 shill::kSaveCredentialsProperty, GetSaveCredentials()); | 720 shill::kSaveCredentialsProperty, GetSaveCredentials()); |
| 721 } else { | 721 } else { |
| 722 const std::string passphrase = GetPassphrase(); | 722 const std::string passphrase = GetPassphrase(); |
| 723 if (!passphrase.empty()) { | 723 if (!passphrase.empty()) { |
| 724 properties.SetStringWithoutPathExpansion( | 724 properties.SetStringWithoutPathExpansion( |
| 725 shill::kPassphraseProperty, passphrase); | 725 shill::kPassphraseProperty, passphrase); |
| 726 } | 726 } |
| 727 } | 727 } |
| 728 if (network->type() == shill::kTypeEthernet) { | 728 if (network->type() == shill::kTypeEthernet) { |
| 729 // When configuring an ethernet service, we actually configure the | 729 // When configuring an ethernet service, we actually configure the |
| 730 // EthernetEap service, which exists in the Profile only. | 730 // EthernetEap service, which exists in the Profile only. |
| 731 // See crbug.com/126870 for more info. | 731 // See crbug.com/126870 for more info. |
| 732 properties.SetStringWithoutPathExpansion(shill::kTypeProperty, | 732 properties.SetStringWithoutPathExpansion(shill::kTypeProperty, |
| 733 shill::kTypeEthernetEap); | 733 shill::kTypeEthernetEap); |
| 734 share_network = false; | 734 share_network = false; |
| 735 ash::network_connect::CreateConfiguration(&properties, share_network); | 735 ash::NetworkConnect::Get()->CreateConfiguration(&properties, |
| 736 share_network); |
| 736 } else { | 737 } else { |
| 737 ash::network_connect::ConfigureNetworkAndConnect( | 738 ash::NetworkConnect::Get()->ConfigureNetworkAndConnect( |
| 738 service_path_, properties, share_network); | 739 service_path_, properties, share_network); |
| 739 } | 740 } |
| 740 } | 741 } |
| 741 return true; // dialog will be closed | 742 return true; // dialog will be closed |
| 742 } | 743 } |
| 743 | 744 |
| 744 std::string WifiConfigView::GetSsid() const { | 745 std::string WifiConfigView::GetSsid() const { |
| 745 std::string result; | 746 std::string result; |
| 746 if (ssid_textfield_ != NULL) { | 747 if (ssid_textfield_ != NULL) { |
| 747 std::string untrimmed = base::UTF16ToUTF8(ssid_textfield_->text()); | 748 std::string untrimmed = base::UTF16ToUTF8(ssid_textfield_->text()); |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 void WifiConfigView::ParseEAPUIProperty(NetworkPropertyUIData* property_ui_data, | 1377 void WifiConfigView::ParseEAPUIProperty(NetworkPropertyUIData* property_ui_data, |
| 1377 const NetworkState* network, | 1378 const NetworkState* network, |
| 1378 const std::string& key) { | 1379 const std::string& key) { |
| 1379 std::string onc_tag = network->type() == shill::kTypeEthernet | 1380 std::string onc_tag = network->type() == shill::kTypeEthernet |
| 1380 ? ::onc::ethernet::kEAP | 1381 ? ::onc::ethernet::kEAP |
| 1381 : ::onc::wifi::kEAP; | 1382 : ::onc::wifi::kEAP; |
| 1382 ParseUIProperty(property_ui_data, network, onc_tag + '.' + key); | 1383 ParseUIProperty(property_ui_data, network, onc_tag + '.' + key); |
| 1383 } | 1384 } |
| 1384 | 1385 |
| 1385 } // namespace chromeos | 1386 } // namespace chromeos |
| OLD | NEW |