Chromium Code Reviews| Index: chrome/browser/chromeos/login/existing_user_view.cc |
| =================================================================== |
| --- chrome/browser/chromeos/login/existing_user_view.cc (revision 60696) |
| +++ chrome/browser/chromeos/login/existing_user_view.cc (working copy) |
| @@ -7,6 +7,7 @@ |
| #include "app/l10n_util.h" |
| #include "chrome/browser/chromeos/login/helper.h" |
| #include "chrome/browser/chromeos/login/user_controller.h" |
| +#include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
| #include "grit/generated_resources.h" |
| #include "views/focus/focus_manager.h" |
| #include "views/grid_layout.h" |
| @@ -69,12 +70,13 @@ |
| DISALLOW_COPY_AND_ASSIGN(UserEntryTextfield); |
| }; |
| + |
| ExistingUserView::ExistingUserView(UserController* uc) |
| - : accel_login_off_the_record_( |
| - views::Accelerator(app::VKEY_B, false, false, true)), |
| - password_field_(NULL), |
| + : password_field_(NULL), |
| submit_button_(NULL), |
| - user_controller_(uc) { |
| + user_controller_(uc), |
| + accel_enable_accessibility_( |
| + WizardAccessibilityHelper::GetAccelerator()) { |
| AddAccelerator(accel_login_off_the_record_); |
| } |
| @@ -108,8 +110,28 @@ |
| SetLayoutManager(layout); |
| layout->Layout(this); |
| SchedulePaint(); |
| + AddAccelerator(accel_enable_accessibility_); |
|
Nikita (slow)
2010/09/29 14:10:23
I'm moving this call to ctor.
RecreateFields is ca
|
| } |
| +bool ExistingUserView::AcceleratorPressed( |
| + const views::Accelerator& accelerator) { |
| + if (accelerator == accel_login_off_the_record_) { |
| + user_controller_->OnLoginOffTheRecord(); |
| + return true; |
| + } else if (accelerator == accel_enable_accessibility_) { |
| + WizardAccessibilityHelper::GetInstance()->EnableAccessibility(this); |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| +void ExistingUserView::ViewHierarchyChanged(bool is_add, |
| + views::View* parent, |
| + views::View* child) { |
| + if (is_add && this == child) |
| + WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); |
| +} |
| + |
| void ExistingUserView::FocusPasswordField() { |
| if (GetFocusManager()) { |
| password_field()->RequestFocus(); |
| @@ -119,15 +141,4 @@ |
| void ExistingUserView::OnLocaleChanged() { |
| RecreateFields(); |
| } |
| - |
| - |
| -bool ExistingUserView::AcceleratorPressed( |
| - const views::Accelerator& accelerator) { |
| - if (accelerator == accel_login_off_the_record_) { |
| - user_controller_->OnLoginOffTheRecord(); |
| - return true; |
| - } |
| - return false; |
| -} |
| - |
| } // namespace chromeos |