Chromium Code Reviews| Index: chrome/browser/chromeos/login/guest_user_view.cc |
| diff --git a/chrome/browser/chromeos/login/guest_user_view.cc b/chrome/browser/chromeos/login/guest_user_view.cc |
| index a06e01785ced6a601a4192b4b40fb8167633d3c6..38fc702f7c9a99bb850c0544f94684299366ef9d 100644 |
| --- a/chrome/browser/chromeos/login/guest_user_view.cc |
| +++ b/chrome/browser/chromeos/login/guest_user_view.cc |
| @@ -15,16 +15,16 @@ namespace chromeos { |
| // Button with custom processing for Tab/Shift+Tab to select entries. |
| class UserEntryButton : public login::WideButton { |
| public: |
| - UserEntryButton(UserController* controller, |
| + UserEntryButton(views::ButtonListener* button_listener, |
| + UserController* user_controller, |
| const std::wstring& label) |
| - : WideButton(controller, label), |
| - controller_(controller) {} |
| + : WideButton(button_listener, label), |
| + user_controller_(user_controller) {} |
| // Overridden from views::View: |
| virtual bool OnKeyPressed(const views::KeyEvent& e) { |
| if (e.GetKeyCode() == app::VKEY_TAB) { |
| - int index = controller_->user_index() + (e.IsShiftDown() ? -1 : 1); |
| - controller_->SelectUser(index); |
| + user_controller_->SelectUserRelative(e.IsShiftDown() ? -1 : 1); |
| return true; |
| } |
| return WideButton::OnKeyPressed(e); |
| @@ -37,7 +37,7 @@ class UserEntryButton : public login::WideButton { |
| } |
| private: |
| - UserController* controller_; |
| + UserController* user_controller_; |
| DISALLOW_COPY_AND_ASSIGN(UserEntryButton); |
| }; |
| @@ -63,6 +63,7 @@ GuestUserView::GuestUserView(UserController* uc) |
| void GuestUserView::RecreateFields() { |
| delete submit_button_; |
| submit_button_ = new UserEntryButton( |
| + this, |
| user_controller_, |
| l10n_util::GetString(IDS_ENTER_GUEST_SESSION_BUTTON)); |
| AddChildView(submit_button_); |
| @@ -71,8 +72,7 @@ void GuestUserView::RecreateFields() { |
| } |
| void GuestUserView::FocusSignInButton() { |
| - if (GetFocusManager()) |
| - submit_button_->RequestFocus(); |
| + submit_button_->RequestFocus(); |
| } |
| bool GuestUserView::AcceleratorPressed( |
| @@ -82,14 +82,23 @@ bool GuestUserView::AcceleratorPressed( |
| else if (accelerator == accel_enable_accessibility_) |
| WizardAccessibilityHelper::GetInstance()->EnableAccessibility(this); |
| else if (accelerator == accel_previous_pod_by_arrow_) |
| - user_controller_->SelectUser(user_controller_->user_index() - 1); |
| + user_controller_->SelectUserRelative(-1); |
| else if (accelerator == accel_next_pod_by_arrow_) |
| - user_controller_->SelectUser(user_controller_->user_index() + 1); |
| + user_controller_->SelectUserRelative(1); |
| else |
| return false; |
| return true; |
| } |
| +void GuestUserView::ButtonPressed( |
| + views::Button* sender, const views::Event& event) { |
| + user_controller_->OnLoginOffTheRecord(); |
|
whywhat
2010/12/09 16:20:18
DCHECK or maybe even CHECK for button being what w
altimofeev
2010/12/10 16:37:40
DCHECK has been added.
|
| +} |
| + |
| +void GuestUserView::EnableInputControls(bool enabled) { |
| + submit_button_->SetEnabled(enabled); |
| +} |
| + |
| void GuestUserView::ViewHierarchyChanged(bool is_add, |
| views::View* parent, |
| views::View* child) { |
| @@ -111,4 +120,20 @@ void GuestUserView::Layout() { |
| submit_button_size.height()); |
| } |
| +void GuestUserView::ClearAndFocusControls() { |
| +} |
| + |
| +void GuestUserView::ClearAndFocusPassword() { |
| +} |
| + |
| +gfx::Rect GuestUserView::GetControlWithErrorBounds() const { |
| + NOTREACHED(); |
| + return gfx::Rect(); |
| +} |
| + |
| +bool GuestUserView::UseCustomBoundsForThrobber ( |
| + const gfx::Size& /*throbber*/, gfx::Rect* /*bounds*/) const { |
| + return false; |
| +} |
| + |
| } // namespace chromeos |