| 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/login/user_manager.h" | 10 #include "chrome/browser/chromeos/login/user_manager.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::HandleKeyEvent(views::Textfield* sender, | 152 bool WifiConfigView::HandleKeyEvent(views::Textfield* sender, |
| 153 const views::KeyEvent& key_event) { | 153 const views::KeyEvent& key_event) { |
| 154 if (sender == passphrase_textfield_ && | 154 if (sender == passphrase_textfield_ && |
| 155 key_event.GetKeyCode() == ui::VKEY_RETURN) { | 155 key_event.key_code() == ui::VKEY_RETURN) { |
| 156 parent_->GetDialogClientView()->AcceptWindow(); | 156 parent_->GetDialogClientView()->AcceptWindow(); |
| 157 } | 157 } |
| 158 return false; | 158 return false; |
| 159 } | 159 } |
| 160 | 160 |
| 161 void WifiConfigView::ButtonPressed(views::Button* sender, | 161 void WifiConfigView::ButtonPressed(views::Button* sender, |
| 162 const views::Event& event) { | 162 const views::Event& event) { |
| 163 if (sender == passphrase_visible_button_) { | 163 if (sender == passphrase_visible_button_) { |
| 164 if (passphrase_textfield_) | 164 if (passphrase_textfield_) |
| 165 passphrase_textfield_->SetPassword(!passphrase_textfield_->IsPassword()); | 165 passphrase_textfield_->SetPassword(!passphrase_textfield_->IsPassword()); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 error_label_ = new views::Label(); | 410 error_label_ = new views::Label(); |
| 411 error_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 411 error_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
| 412 error_label_->SetColor(SK_ColorRED); | 412 error_label_->SetColor(SK_ColorRED); |
| 413 layout->AddView(error_label_); | 413 layout->AddView(error_label_); |
| 414 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 414 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 415 // Set or hide the error text. | 415 // Set or hide the error text. |
| 416 UpdateErrorLabel(false); | 416 UpdateErrorLabel(false); |
| 417 } | 417 } |
| 418 | 418 |
| 419 } // namespace chromeos | 419 } // namespace chromeos |
| OLD | NEW |