| 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/guest_user_view.h" | 5 #include "chrome/browser/chromeos/login/guest_user_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "chrome/browser/chromeos/login/user_controller.h" | 8 #include "chrome/browser/chromeos/login/user_controller.h" |
| 9 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | 9 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 private: | 38 private: |
| 39 UserController* user_controller_; | 39 UserController* user_controller_; |
| 40 | 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(UserEntryButton); | 41 DISALLOW_COPY_AND_ASSIGN(UserEntryButton); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 | 44 |
| 45 GuestUserView::GuestUserView(UserController* uc) | 45 GuestUserView::GuestUserView(UserController* uc) |
| 46 : submit_button_(NULL), | 46 : submit_button_(NULL), |
| 47 user_controller_(uc), | 47 user_controller_(uc), |
| 48 accel_enable_accessibility_( | 48 accel_toggle_accessibility_( |
| 49 WizardAccessibilityHelper::GetAccelerator()), | 49 WizardAccessibilityHelper::GetAccelerator()), |
| 50 accel_login_off_the_record_( | 50 accel_login_off_the_record_( |
| 51 views::Accelerator(app::VKEY_B, false, false, true)), | 51 views::Accelerator(app::VKEY_B, false, false, true)), |
| 52 accel_previous_pod_by_arrow_( | 52 accel_previous_pod_by_arrow_( |
| 53 views::Accelerator(app::VKEY_LEFT, false, false, false)), | 53 views::Accelerator(app::VKEY_LEFT, false, false, false)), |
| 54 accel_next_pod_by_arrow_( | 54 accel_next_pod_by_arrow_( |
| 55 views::Accelerator(app::VKEY_RIGHT, false, false, false)) { | 55 views::Accelerator(app::VKEY_RIGHT, false, false, false)) { |
| 56 AddAccelerator(accel_enable_accessibility_); | 56 AddAccelerator(accel_toggle_accessibility_); |
| 57 AddAccelerator(accel_login_off_the_record_); | 57 AddAccelerator(accel_login_off_the_record_); |
| 58 AddAccelerator(accel_previous_pod_by_arrow_); | 58 AddAccelerator(accel_previous_pod_by_arrow_); |
| 59 AddAccelerator(accel_next_pod_by_arrow_); | 59 AddAccelerator(accel_next_pod_by_arrow_); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void GuestUserView::RecreateFields() { | 62 void GuestUserView::RecreateFields() { |
| 63 delete submit_button_; | 63 delete submit_button_; |
| 64 submit_button_ = new UserEntryButton( | 64 submit_button_ = new UserEntryButton( |
| 65 this, | 65 this, |
| 66 user_controller_, | 66 user_controller_, |
| 67 l10n_util::GetString(IDS_ENTER_GUEST_SESSION_BUTTON)); | 67 l10n_util::GetString(IDS_ENTER_GUEST_SESSION_BUTTON)); |
| 68 AddChildView(submit_button_); | 68 AddChildView(submit_button_); |
| 69 Layout(); | 69 Layout(); |
| 70 SchedulePaint(); | 70 SchedulePaint(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void GuestUserView::FocusSignInButton() { | 73 void GuestUserView::FocusSignInButton() { |
| 74 submit_button_->RequestFocus(); | 74 submit_button_->RequestFocus(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool GuestUserView::AcceleratorPressed( | 77 bool GuestUserView::AcceleratorPressed( |
| 78 const views::Accelerator& accelerator) { | 78 const views::Accelerator& accelerator) { |
| 79 if (accelerator == accel_login_off_the_record_) | 79 if (accelerator == accel_login_off_the_record_) |
| 80 user_controller_->OnLoginOffTheRecord(); | 80 user_controller_->OnLoginOffTheRecord(); |
| 81 else if (accelerator == accel_enable_accessibility_) | 81 else if (accelerator == accel_toggle_accessibility_) |
| 82 WizardAccessibilityHelper::GetInstance()->EnableAccessibility(this); | 82 WizardAccessibilityHelper::GetInstance()->ToggleAccessibility(this); |
| 83 else if (accelerator == accel_previous_pod_by_arrow_) | 83 else if (accelerator == accel_previous_pod_by_arrow_) |
| 84 user_controller_->SelectUserRelative(-1); | 84 user_controller_->SelectUserRelative(-1); |
| 85 else if (accelerator == accel_next_pod_by_arrow_) | 85 else if (accelerator == accel_next_pod_by_arrow_) |
| 86 user_controller_->SelectUserRelative(1); | 86 user_controller_->SelectUserRelative(1); |
| 87 else | 87 else |
| 88 return false; | 88 return false; |
| 89 return true; | 89 return true; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void GuestUserView::ButtonPressed( | 92 void GuestUserView::ButtonPressed( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 void GuestUserView::ClearAndFocusPassword() { | 126 void GuestUserView::ClearAndFocusPassword() { |
| 127 } | 127 } |
| 128 | 128 |
| 129 gfx::Rect GuestUserView::GetMainInputScreenBounds() const { | 129 gfx::Rect GuestUserView::GetMainInputScreenBounds() const { |
| 130 NOTREACHED(); | 130 NOTREACHED(); |
| 131 return gfx::Rect(); | 131 return gfx::Rect(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace chromeos | 134 } // namespace chromeos |
| OLD | NEW |