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

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

Issue 5709001: Place the spinner in the right corner of the controls window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos/login
Patch Set: Merged with trunk. Created 10 years 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/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

Powered by Google App Engine
This is Rietveld 408576698