OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } else { | 142 } else { |
143 error_label_->SetVisible(false); | 143 error_label_->SetVisible(false); |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 void WifiConfigView::ContentsChanged(views::Textfield* sender, | 147 void WifiConfigView::ContentsChanged(views::Textfield* sender, |
148 const string16& new_contents) { | 148 const string16& new_contents) { |
149 UpdateCanLogin(); | 149 UpdateCanLogin(); |
150 } | 150 } |
151 | 151 |
152 bool WifiConfigView::HandleKeystroke( | 152 bool WifiConfigView::HandleKeyEvent(views::Textfield* sender, |
153 views::Textfield* sender, | 153 const views::KeyEvent& key_event) { |
154 const views::Textfield::Keystroke& keystroke) { | |
155 if (sender == passphrase_textfield_ && | 154 if (sender == passphrase_textfield_ && |
156 keystroke.GetKeyboardCode() == app::VKEY_RETURN) { | 155 key_event.GetKeyCode() == app::VKEY_RETURN) { |
157 parent_->GetDialogClientView()->AcceptWindow(); | 156 parent_->GetDialogClientView()->AcceptWindow(); |
158 } | 157 } |
159 return false; | 158 return false; |
160 } | 159 } |
161 | 160 |
162 void WifiConfigView::ButtonPressed(views::Button* sender, | 161 void WifiConfigView::ButtonPressed(views::Button* sender, |
163 const views::Event& event) { | 162 const views::Event& event) { |
164 if (sender == passphrase_visible_button_) { | 163 if (sender == passphrase_visible_button_) { |
165 if (passphrase_textfield_) | 164 if (passphrase_textfield_) |
166 passphrase_textfield_->SetPassword(!passphrase_textfield_->IsPassword()); | 165 passphrase_textfield_->SetPassword(!passphrase_textfield_->IsPassword()); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 error_label_ = new views::Label(); | 407 error_label_ = new views::Label(); |
409 error_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 408 error_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
410 error_label_->SetColor(SK_ColorRED); | 409 error_label_->SetColor(SK_ColorRED); |
411 layout->AddView(error_label_); | 410 layout->AddView(error_label_); |
412 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 411 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
413 // Set or hide the error text. | 412 // Set or hide the error text. |
414 UpdateErrorLabel(false); | 413 UpdateErrorLabel(false); |
415 } | 414 } |
416 | 415 |
417 } // namespace chromeos | 416 } // namespace chromeos |
OLD | NEW |