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/login/existing_user_view.h" | 5 #include "chrome/browser/chromeos/login/existing_user_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/chromeos/login/user_controller.h" | 9 #include "chrome/browser/chromeos/login/user_controller.h" |
10 #include "chrome/browser/chromeos/login/textfield_with_margin.h" | 10 #include "chrome/browser/chromeos/login/textfield_with_margin.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 if (accelerator == accel_login_off_the_record_) { | 95 if (accelerator == accel_login_off_the_record_) { |
96 user_controller_->OnLoginOffTheRecord(); | 96 user_controller_->OnLoginOffTheRecord(); |
97 return true; | 97 return true; |
98 } else if (accelerator == accel_toggle_accessibility_) { | 98 } else if (accelerator == accel_toggle_accessibility_) { |
99 WizardAccessibilityHelper::GetInstance()->ToggleAccessibility(this); | 99 WizardAccessibilityHelper::GetInstance()->ToggleAccessibility(this); |
100 return true; | 100 return true; |
101 } | 101 } |
102 return false; | 102 return false; |
103 } | 103 } |
104 | 104 |
105 bool ExistingUserView::HandleKeystroke( | 105 bool ExistingUserView::HandleKeyEvent(views::Textfield* sender, |
106 views::Textfield* sender, | 106 const views::KeyEvent& key_event) { |
107 const views::Textfield::Keystroke& keystroke) { | 107 if (key_event.GetKeyCode() == app::VKEY_RETURN) { |
108 if (keystroke.GetKeyboardCode() == app::VKEY_RETURN) { | |
109 if (!password_field_->text().empty()) | 108 if (!password_field_->text().empty()) |
110 user_controller_->OnLogin("", UTF16ToUTF8(password_field_->text())); | 109 user_controller_->OnLogin("", UTF16ToUTF8(password_field_->text())); |
111 } else { | 110 } else { |
112 user_controller_->ClearErrors(); | 111 user_controller_->ClearErrors(); |
113 return false; | 112 return false; |
114 } | 113 } |
115 return true; | 114 return true; |
116 } | 115 } |
117 | 116 |
118 void ExistingUserView::ContentsChanged(views::Textfield* sender, | 117 void ExistingUserView::ContentsChanged(views::Textfield* sender, |
(...skipping 26 matching lines...) Expand all Loading... |
145 | 144 |
146 gfx::Rect ExistingUserView::GetMainInputScreenBounds() const { | 145 gfx::Rect ExistingUserView::GetMainInputScreenBounds() const { |
147 return password_field_->GetScreenBounds(); | 146 return password_field_->GetScreenBounds(); |
148 } | 147 } |
149 | 148 |
150 void ExistingUserView::OnLocaleChanged() { | 149 void ExistingUserView::OnLocaleChanged() { |
151 RecreateFields(); | 150 RecreateFields(); |
152 } | 151 } |
153 | 152 |
154 } // namespace chromeos | 153 } // namespace chromeos |
OLD | NEW |