| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/chromeos/network/network_connect.h" | 5 #include "ui/chromeos/network/network_connect.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 const std::string& service_path) { | 137 const std::string& service_path) { |
| 138 const NetworkState* network = GetNetworkState(service_path); | 138 const NetworkState* network = GetNetworkState(service_path); |
| 139 if (!network) { | 139 if (!network) { |
| 140 NET_LOG_ERROR("Configuring unknown network", service_path); | 140 NET_LOG_ERROR("Configuring unknown network", service_path); |
| 141 return; | 141 return; |
| 142 } | 142 } |
| 143 | 143 |
| 144 if (network->type() == shill::kTypeWifi) { | 144 if (network->type() == shill::kTypeWifi) { |
| 145 // Only show the config view for secure networks, otherwise do nothing. | 145 // Only show the config view for secure networks, otherwise do nothing. |
| 146 if (network->security_class() != shill::kSecurityNone) { | 146 if (network->security_class() != shill::kSecurityNone) { |
| 147 delegate_->ShowNetworkConfigure(service_path); | 147 delegate_->ShowNetworkConfigure(network->guid()); |
| 148 } | 148 } |
| 149 return; | 149 return; |
| 150 } | 150 } |
| 151 | 151 |
| 152 if (network->type() == shill::kTypeWimax) { | 152 if (network->type() == shill::kTypeWimax) { |
| 153 delegate_->ShowNetworkConfigure(service_path); | 153 delegate_->ShowNetworkConfigure(network->guid()); |
| 154 return; | 154 return; |
| 155 } | 155 } |
| 156 | 156 |
| 157 if (network->type() == shill::kTypeVPN) { | 157 if (network->type() == shill::kTypeVPN) { |
| 158 // Third-party VPNs handle configuration UI themselves. | 158 // Third-party VPNs handle configuration UI themselves. |
| 159 if (network->vpn_provider_type() != shill::kProviderThirdPartyVpn) | 159 if (network->vpn_provider_type() != shill::kProviderThirdPartyVpn) |
| 160 delegate_->ShowNetworkConfigure(service_path); | 160 delegate_->ShowNetworkConfigure(network->guid()); |
| 161 return; | 161 return; |
| 162 } | 162 } |
| 163 | 163 |
| 164 if (network->type() == shill::kTypeCellular) { | 164 if (network->type() == shill::kTypeCellular) { |
| 165 if (network->RequiresActivation()) { | 165 if (network->RequiresActivation()) { |
| 166 ActivateCellular(service_path); | 166 ActivateCellular(service_path); |
| 167 return; | 167 return; |
| 168 } | 168 } |
| 169 if (network->cellular_out_of_credits()) { | 169 if (network->cellular_out_of_credits()) { |
| 170 ShowMobileSetup(service_path); | 170 ShowMobileSetup(service_path); |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 if (base::ToLowerASCII(error) == base::ToLowerASCII(shill::kUnknownString)) { | 617 if (base::ToLowerASCII(error) == base::ToLowerASCII(shill::kUnknownString)) { |
| 618 return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); | 618 return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); |
| 619 } | 619 } |
| 620 return l10n_util::GetStringFUTF16(IDS_NETWORK_UNRECOGNIZED_ERROR, | 620 return l10n_util::GetStringFUTF16(IDS_NETWORK_UNRECOGNIZED_ERROR, |
| 621 base::UTF8ToUTF16(error)); | 621 base::UTF8ToUTF16(error)); |
| 622 } | 622 } |
| 623 | 623 |
| 624 void NetworkConnectImpl::ShowNetworkSettingsForPath( | 624 void NetworkConnectImpl::ShowNetworkSettingsForPath( |
| 625 const std::string& service_path) { | 625 const std::string& service_path) { |
| 626 const NetworkState* network = GetNetworkState(service_path); | 626 const NetworkState* network = GetNetworkState(service_path); |
| 627 delegate_->ShowNetworkSettingsForGuid(network ? network->guid() : ""); | 627 delegate_->ShowNetworkSettings(network ? network->guid() : ""); |
| 628 } | 628 } |
| 629 | 629 |
| 630 } // namespace | 630 } // namespace |
| 631 | 631 |
| 632 const char NetworkConnect::kErrorActivateFailed[] = "activate-failed"; | 632 const char NetworkConnect::kErrorActivateFailed[] = "activate-failed"; |
| 633 | 633 |
| 634 static NetworkConnect* g_network_connect = NULL; | 634 static NetworkConnect* g_network_connect = NULL; |
| 635 | 635 |
| 636 // static | 636 // static |
| 637 void NetworkConnect::Initialize(Delegate* delegate) { | 637 void NetworkConnect::Initialize(Delegate* delegate) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 652 return g_network_connect; | 652 return g_network_connect; |
| 653 } | 653 } |
| 654 | 654 |
| 655 NetworkConnect::NetworkConnect() { | 655 NetworkConnect::NetworkConnect() { |
| 656 } | 656 } |
| 657 | 657 |
| 658 NetworkConnect::~NetworkConnect() { | 658 NetworkConnect::~NetworkConnect() { |
| 659 } | 659 } |
| 660 | 660 |
| 661 } // namespace ui | 661 } // namespace ui |
| OLD | NEW |