Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: chrome/browser/chromeos/options/wimax_config_view.cc

Issue 120503005: Merge NativeTextfieldViews into views::Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix touch drag and drop unit test. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 bool WimaxConfigView::CanLogin() { 84 bool WimaxConfigView::CanLogin() {
85 // In OOBE it may be valid to log in with no credentials (crbug.com/137776). 85 // In OOBE it may be valid to log in with no credentials (crbug.com/137776).
86 if (!chromeos::StartupUtils::IsOobeCompleted()) 86 if (!chromeos::StartupUtils::IsOobeCompleted())
87 return true; 87 return true;
88 88
89 // TODO(benchan): Update this with the correct minimum length (don't just 89 // TODO(benchan): Update this with the correct minimum length (don't just
90 // check if empty). 90 // check if empty).
91 // If the network requires a passphrase, make sure it is the right length. 91 // If the network requires a passphrase, make sure it is the right length.
92 return passphrase_textfield_ && !passphrase_textfield_->text().empty(); 92 return passphrase_textfield_ && !passphrase_textfield_->GetText().empty();
93 } 93 }
94 94
95 void WimaxConfigView::UpdateDialogButtons() { 95 void WimaxConfigView::UpdateDialogButtons() {
96 parent_->GetDialogClientView()->UpdateDialogButtons(); 96 parent_->GetDialogClientView()->UpdateDialogButtons();
97 } 97 }
98 98
99 void WimaxConfigView::UpdateErrorLabel() { 99 void WimaxConfigView::UpdateErrorLabel() {
100 base::string16 error_msg; 100 base::string16 error_msg;
101 if (!service_path_.empty()) { 101 if (!service_path_.empty()) {
102 const NetworkState* wimax = NetworkHandler::Get()->network_state_handler()-> 102 const NetworkState* wimax = NetworkHandler::Get()->network_state_handler()->
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 false); 167 false);
168 } 168 }
169 169
170 ash::network_connect::ConfigureNetworkAndConnect( 170 ash::network_connect::ConfigureNetworkAndConnect(
171 service_path_, properties, share_network); 171 service_path_, properties, share_network);
172 return true; // dialog will be closed 172 return true; // dialog will be closed
173 } 173 }
174 174
175 std::string WimaxConfigView::GetEapIdentity() const { 175 std::string WimaxConfigView::GetEapIdentity() const {
176 DCHECK(identity_textfield_); 176 DCHECK(identity_textfield_);
177 return base::UTF16ToUTF8(identity_textfield_->text()); 177 return base::UTF16ToUTF8(identity_textfield_->GetText());
178 } 178 }
179 179
180 std::string WimaxConfigView::GetEapPassphrase() const { 180 std::string WimaxConfigView::GetEapPassphrase() const {
181 return passphrase_textfield_ ? base::UTF16ToUTF8( 181 return passphrase_textfield_ ? base::UTF16ToUTF8(
182 passphrase_textfield_->text()) : 182 passphrase_textfield_->GetText()) :
183 std::string(); 183 std::string();
184 } 184 }
185 185
186 bool WimaxConfigView::GetSaveCredentials() const { 186 bool WimaxConfigView::GetSaveCredentials() const {
187 return save_credentials_checkbox_ ? save_credentials_checkbox_->checked() : 187 return save_credentials_checkbox_ ? save_credentials_checkbox_->checked() :
188 false; 188 false;
189 } 189 }
190 190
191 bool WimaxConfigView::GetShareNetwork(bool share_default) const { 191 bool WimaxConfigView::GetShareNetwork(bool share_default) const {
192 return share_network_checkbox_ ? share_network_checkbox_->checked() : 192 return share_network_checkbox_ ? share_network_checkbox_->checked() :
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 } 372 }
373 } 373 }
374 374
375 void WimaxConfigView::InitFocus() { 375 void WimaxConfigView::InitFocus() {
376 views::View* view_to_focus = GetInitiallyFocusedView(); 376 views::View* view_to_focus = GetInitiallyFocusedView();
377 if (view_to_focus) 377 if (view_to_focus)
378 view_to_focus->RequestFocus(); 378 view_to_focus->RequestFocus();
379 } 379 }
380 380
381 } // namespace chromeos 381 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698