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

Unified Diff: chrome/browser/chromeos/login/new_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/new_user_view.cc
diff --git a/chrome/browser/chromeos/login/new_user_view.cc b/chrome/browser/chromeos/login/new_user_view.cc
index 974ad66860053bdf3ccb9e1003a9615910eeeb56..0df7502432ca928e7c025099d61c30ca8289044a 100644
--- a/chrome/browser/chromeos/login/new_user_view.cc
+++ b/chrome/browser/chromeos/login/new_user_view.cc
@@ -95,7 +95,6 @@ NewUserView::NewUserView(Delegate* delegate,
create_account_link_(NULL),
guest_link_(NULL),
languages_menubutton_(NULL),
- throbber_(NULL),
accel_focus_pass_(views::Accelerator(app::VKEY_P, false, false, true)),
whywhat 2010/12/09 16:20:18 Do we need to initialize throbber positions here t
altimofeev 2010/12/10 16:37:40 Added impossible initial value for |throbber_cente
accel_focus_user_(views::Accelerator(app::VKEY_U, false, false, true)),
accel_login_off_the_record_(
@@ -158,9 +157,6 @@ void NewUserView::Init() {
password_field_->set_background(new CopyBackground(this));
AddChildView(password_field_);
- throbber_ = CreateDefaultSmoothedThrobber();
- AddChildView(throbber_);
-
language_switch_menu_.InitLanguageMenu();
RecreatePeculiarControls();
@@ -420,12 +416,11 @@ void NewUserView::Layout() {
int throbber_y = y;
int sign_in_button_width = sign_in_button_->GetPreferredSize().width();
setViewBounds(sign_in_button_, x, y, sign_in_button_width,true);
- setViewBounds(throbber_,
- x + width - throbber_->GetPreferredSize().width(),
- throbber_y + (sign_in_button_->GetPreferredSize().height() -
- throbber_->GetPreferredSize().height()) / 2,
- width,
- false);
+
+
+ throbber_right_ = x + width;
+ throbber_center_y_ =
+ throbber_y + sign_in_button_->GetPreferredSize().height() / 2;
SchedulePaint();
}
@@ -448,9 +443,7 @@ void NewUserView::Login() {
if (login_in_process_ || username_field_->text().empty())
return;
- StartThrobber();
login_in_process_ = true;
- EnableInputControls(false);
std::string username = UTF16ToUTF8(username_field_->text());
// todo(cmasone) Need to sanitize memory used to store password.
std::string password = UTF16ToUTF8(password_field_->text());
@@ -478,37 +471,38 @@ void NewUserView::LinkActivated(views::Link* source, int event_flags) {
}
}
-void NewUserView::ClearAndEnablePassword() {
+void NewUserView::ClearAndFocusControls() {
login_in_process_ = false;
- EnableInputControls(true);
+ SetUsername(std::string());
SetPassword(std::string());
- password_field_->RequestFocus();
- StopThrobber();
+ username_field_->RequestFocus();
}
-void NewUserView::ClearAndEnableFields() {
+void NewUserView::ClearAndFocusPassword() {
login_in_process_ = false;
- EnableInputControls(true);
- SetUsername(std::string());
SetPassword(std::string());
- username_field_->RequestFocus();
- StopThrobber();
+ password_field_->RequestFocus();
}
-gfx::Rect NewUserView::GetPasswordBounds() const {
- return password_field_->GetScreenBounds();
+gfx::Rect NewUserView::GetControlWithErrorBounds() const {
+ return GetUsernameBounds();
}
-gfx::Rect NewUserView::GetUsernameBounds() const {
- return username_field_->GetScreenBounds();
+bool NewUserView::UseCustomBoundsForThrobber(const gfx::Size& throbber,
+ gfx::Rect* bounds) const {
+ gfx::Point origin(throbber_right_- throbber.width(),
+ throbber_center_y_ - throbber.height() / 2);
whywhat 2010/12/09 16:20:18 Move this one space to the right. Also as I noted
altimofeev 2010/12/10 16:37:40 Added call to Layout() if there wasn't any.
+ bounds->set_origin(origin);
+ bounds->set_size(throbber);
+ return true;
}
-void NewUserView::StartThrobber() {
- throbber_->Start();
+gfx::Rect NewUserView::GetPasswordBounds() const {
+ return password_field_->GetScreenBounds();
}
-void NewUserView::StopThrobber() {
- throbber_->Stop();
+gfx::Rect NewUserView::GetUsernameBounds() const {
+ return username_field_->GetScreenBounds();
}
bool NewUserView::HandleKeystroke(views::Textfield* s,
@@ -549,7 +543,6 @@ void NewUserView::EnableInputControls(bool enabled) {
if (need_guest_link_) {
guest_link_->SetEnabled(enabled);
}
- delegate_->SetStatusAreaEnabled(enabled);
}
void NewUserView::InitLink(views::Link** link) {

Powered by Google App Engine
This is Rietveld 408576698