| 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/wimax_config_view.h" | 5 #include "chrome/browser/chromeos/options/wimax_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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 void WimaxConfigView::UpdateDialogButtons() { | 94 void WimaxConfigView::UpdateDialogButtons() { |
| 95 parent_->GetDialogClientView()->UpdateDialogButtons(); | 95 parent_->GetDialogClientView()->UpdateDialogButtons(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void WimaxConfigView::UpdateErrorLabel() { | 98 void WimaxConfigView::UpdateErrorLabel() { |
| 99 base::string16 error_msg; | 99 base::string16 error_msg; |
| 100 if (!service_path_.empty()) { | 100 if (!service_path_.empty()) { |
| 101 const NetworkState* wimax = NetworkHandler::Get()->network_state_handler()-> | 101 const NetworkState* wimax = NetworkHandler::Get()->network_state_handler()-> |
| 102 GetNetworkState(service_path_); | 102 GetNetworkState(service_path_); |
| 103 if (wimax && wimax->connection_state() == shill::kStateFailure) | 103 if (wimax && wimax->connection_state() == shill::kStateFailure) |
| 104 error_msg = ash::network_connect::ErrorString( | 104 error_msg = ash::NetworkConnect::Get()->GetErrorString( |
| 105 wimax->last_error(), wimax->path()); | 105 wimax->last_error(), wimax->path()); |
| 106 } | 106 } |
| 107 if (!error_msg.empty()) { | 107 if (!error_msg.empty()) { |
| 108 error_label_->SetText(error_msg); | 108 error_label_->SetText(error_msg); |
| 109 error_label_->SetVisible(true); | 109 error_label_->SetVisible(true); |
| 110 } else { | 110 } else { |
| 111 error_label_->SetVisible(false); | 111 error_label_->SetVisible(false); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 const bool share_default = true; | 161 const bool share_default = true; |
| 162 bool share_network = GetShareNetwork(share_default); | 162 bool share_network = GetShareNetwork(share_default); |
| 163 | 163 |
| 164 bool only_policy_autoconnect = | 164 bool only_policy_autoconnect = |
| 165 onc::PolicyAllowsOnlyPolicyNetworksToAutoconnect(!share_network); | 165 onc::PolicyAllowsOnlyPolicyNetworksToAutoconnect(!share_network); |
| 166 if (only_policy_autoconnect) { | 166 if (only_policy_autoconnect) { |
| 167 properties.SetBooleanWithoutPathExpansion(shill::kAutoConnectProperty, | 167 properties.SetBooleanWithoutPathExpansion(shill::kAutoConnectProperty, |
| 168 false); | 168 false); |
| 169 } | 169 } |
| 170 | 170 |
| 171 ash::network_connect::ConfigureNetworkAndConnect( | 171 ash::NetworkConnect::Get()->ConfigureNetworkAndConnect( |
| 172 service_path_, properties, share_network); | 172 service_path_, properties, share_network); |
| 173 return true; // dialog will be closed | 173 return true; // dialog will be closed |
| 174 } | 174 } |
| 175 | 175 |
| 176 std::string WimaxConfigView::GetEapIdentity() const { | 176 std::string WimaxConfigView::GetEapIdentity() const { |
| 177 DCHECK(identity_textfield_); | 177 DCHECK(identity_textfield_); |
| 178 return base::UTF16ToUTF8(identity_textfield_->text()); | 178 return base::UTF16ToUTF8(identity_textfield_->text()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 std::string WimaxConfigView::GetEapPassphrase() const { | 181 std::string WimaxConfigView::GetEapPassphrase() const { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 void WimaxConfigView::InitFocus() { | 377 void WimaxConfigView::InitFocus() { |
| 378 views::View* view_to_focus = GetInitiallyFocusedView(); | 378 views::View* view_to_focus = GetInitiallyFocusedView(); |
| 379 if (view_to_focus) | 379 if (view_to_focus) |
| 380 view_to_focus->RequestFocus(); | 380 view_to_focus->RequestFocus(); |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace chromeos | 383 } // namespace chromeos |
| OLD | NEW |