OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
10 #include "chrome/browser/chromeos/cros/network_library.h" | 10 #include "chrome/browser/chromeos/cros/network_library.h" |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 key_event.key_code() == ui::VKEY_RETURN) { | 494 key_event.key_code() == ui::VKEY_RETURN) { |
495 parent_->GetDialogClientView()->AcceptWindow(); | 495 parent_->GetDialogClientView()->AcceptWindow(); |
496 } | 496 } |
497 return false; | 497 return false; |
498 } | 498 } |
499 | 499 |
500 void WifiConfigView::ButtonPressed(views::Button* sender, | 500 void WifiConfigView::ButtonPressed(views::Button* sender, |
501 const views::Event& event) { | 501 const views::Event& event) { |
502 if (sender == passphrase_visible_button_) { | 502 if (sender == passphrase_visible_button_) { |
503 if (passphrase_textfield_) { | 503 if (passphrase_textfield_) { |
504 passphrase_textfield_->SetPassword(!passphrase_textfield_->IsPassword()); | 504 bool censor = !passphrase_textfield_->IsPassword(); |
505 passphrase_visible_button_->SetToggled( | 505 passphrase_textfield_->SetTextInputType( |
506 !passphrase_textfield_->IsPassword()); | 506 censor ? ui::TEXT_INPUT_TYPE_PASSWORD : ui::TEXT_INPUT_TYPE_TEXT); |
| 507 passphrase_visible_button_->SetToggled(!censor); |
507 } | 508 } |
508 } else { | 509 } else { |
509 NOTREACHED(); | 510 NOTREACHED(); |
510 } | 511 } |
511 } | 512 } |
512 | 513 |
513 void WifiConfigView::ItemChanged(views::Combobox* combo_box, | 514 void WifiConfigView::ItemChanged(views::Combobox* combo_box, |
514 int prev_index, int new_index) { | 515 int prev_index, int new_index) { |
515 if (new_index == prev_index) | 516 if (new_index == prev_index) |
516 return; | 517 return; |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 // Set focus to a reasonable widget, depending on what we're showing. | 1075 // Set focus to a reasonable widget, depending on what we're showing. |
1075 if (ssid_textfield_) | 1076 if (ssid_textfield_) |
1076 ssid_textfield_->RequestFocus(); | 1077 ssid_textfield_->RequestFocus(); |
1077 else if (eap_method_combobox_) | 1078 else if (eap_method_combobox_) |
1078 eap_method_combobox_->RequestFocus(); | 1079 eap_method_combobox_->RequestFocus(); |
1079 else if (passphrase_textfield_ && passphrase_textfield_->IsEnabled()) | 1080 else if (passphrase_textfield_ && passphrase_textfield_->IsEnabled()) |
1080 passphrase_textfield_->RequestFocus(); | 1081 passphrase_textfield_->RequestFocus(); |
1081 } | 1082 } |
1082 | 1083 |
1083 } // namespace chromeos | 1084 } // namespace chromeos |
OLD | NEW |