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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_view.cc

Issue 6034002: Replace Textfield::Keystroke with views::KeyEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: key_code, ET_KEY_PRESS for WM_CHAR Created 9 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) 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/existing_user_view.h ('k') | chrome/browser/chromeos/login/new_user_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698