diff options
author | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 06:40:47 +0000 |
---|---|---|
committer | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 06:40:47 +0000 |
commit | e3712a768be3688524e6a75e0d29f72dafd320ef (patch) | |
tree | 14d86a88a5841e1ad242ea6edbf090d1de69343e | |
parent | 846529960394ab836a5646476e83d7612c4e494d (diff) | |
download | chromium_src-e3712a768be3688524e6a75e0d29f72dafd320ef.zip chromium_src-e3712a768be3688524e6a75e0d29f72dafd320ef.tar.gz chromium_src-e3712a768be3688524e6a75e0d29f72dafd320ef.tar.bz2 |
Clear password filed on failed login.
BUG=crosbug.com/1853
TEST=Type wrong password and press Enter.
Review URL: http://codereview.chromium.org/2086001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47246 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/login/existing_user_controller.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/user_controller.cc | 5 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/user_controller.h | 7 |
3 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 80a5f8b..3b51ce1 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -161,7 +161,7 @@ void ExistingUserController::OnLoginFailure(const std::string& error) { ShowError(IDS_LOGIN_ERROR_AUTHENTICATING); } - controllers_[index_of_view_logging_in_]->SetPasswordEnabled(true); + controllers_[index_of_view_logging_in_]->ClearAndEnablePassword(); // Reenable clicking on other windows. WmIpc::Message message(WM_IPC_MESSAGE_WM_SET_LOGIN_STATE); diff --git a/chrome/browser/chromeos/login/user_controller.cc b/chrome/browser/chromeos/login/user_controller.cc index 5321f8a..23215e3 100644 --- a/chrome/browser/chromeos/login/user_controller.cc +++ b/chrome/browser/chromeos/login/user_controller.cc @@ -117,6 +117,11 @@ void UserController::SetPasswordEnabled(bool enable) { submit_button_->SetEnabled(enable); } +void UserController::ClearAndEnablePassword() { + password_field_->SetText(string16()); + SetPasswordEnabled(true); +} + void UserController::ButtonPressed(views::Button* sender, const views::Event& event) { Login(); diff --git a/chrome/browser/chromeos/login/user_controller.h b/chrome/browser/chromeos/login/user_controller.h index 5d7cde8..61d02ec 100644 --- a/chrome/browser/chromeos/login/user_controller.h +++ b/chrome/browser/chromeos/login/user_controller.h @@ -50,8 +50,8 @@ class UserController : public views::ButtonListener, const UserManager::User& user() const { return user_; } - // Sets the enabled state of the password field to |enable|. - void SetPasswordEnabled(bool enable); + // Resets password text and sets the enabled state of the password. + void ClearAndEnablePassword(); // Returns bounds of password field in screen coordinates. gfx::Rect GetScreenBounds() const; @@ -100,6 +100,9 @@ class UserController : public views::ButtonListener, // when needed. void SetImage(const SkBitmap& image, int desired_width, int desired_height); + // Sets the enabled state of the password field to |enable|. + void SetPasswordEnabled(bool enable); + // Is this the guest user? const bool is_guest_; |