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

Unified Diff: chrome/browser/chromeos/login/login_manager_view.cc

Issue 1390003: add keyboard acclerators to login wizard... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: fix compile errors Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/login_manager_view.cc
===================================================================
--- chrome/browser/chromeos/login/login_manager_view.cc (revision 42821)
+++ chrome/browser/chromeos/login/login_manager_view.cc (working copy)
@@ -71,6 +71,8 @@
error_label_(NULL),
sign_in_button_(NULL),
create_account_button_(NULL),
+ accel_focus_user_(views::Accelerator(base::VKEY_U, false, false, true)),
+ accel_focus_pass_(views::Accelerator(base::VKEY_P, false, false, true)),
observer_(observer),
error_id_(-1),
ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)),
@@ -144,6 +146,9 @@
error_label_->SetFont(label_font);
AddChildView(error_label_);
+ AddAccelerator(accel_focus_user_);
+ AddAccelerator(accel_focus_pass_);
+
UpdateLocalizedStrings();
// Restore previously logged in user.
@@ -167,6 +172,21 @@
}
}
+bool LoginManagerView::AcceleratorPressed(
+ const views::Accelerator& accelerator) {
+ if (accelerator == accel_focus_user_) {
+ username_field_->RequestFocus();
+ return true;
+ }
+
+ if (accelerator == accel_focus_pass_) {
+ password_field_->RequestFocus();
+ return true;
+ }
+
+ return false;
+}
+
void LoginManagerView::UpdateLocalizedStrings() {
title_label_->SetText(l10n_util::GetString(IDS_LOGIN_TITLE));
username_label_->SetText(l10n_util::GetString(IDS_LOGIN_USERNAME));
« no previous file with comments | « chrome/browser/chromeos/login/login_manager_view.h ('k') | chrome/browser/chromeos/login/wizard_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698