Index: chrome/browser/chromeos/login/screen_locker.cc |
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc |
index f59307b41ea1bfa47f6e33f951aedee93a636f23..39f6bdec2d05fb882ea3dc96f14eacedfac67b7d 100644 |
--- a/chrome/browser/chromeos/login/screen_locker.cc |
+++ b/chrome/browser/chromeos/login/screen_locker.cc |
@@ -32,6 +32,7 @@ |
#include "chrome/browser/chromeos/language_preferences.h" |
#include "chrome/browser/chromeos/login/authenticator.h" |
#include "chrome/browser/chromeos/login/background_view.h" |
+#include "chrome/browser/chromeos/login/helper.h" |
#include "chrome/browser/chromeos/login/login_performer.h" |
#include "chrome/browser/chromeos/login/login_utils.h" |
#include "chrome/browser/chromeos/login/message_bubble.h" |
@@ -622,7 +623,8 @@ ScreenLocker::ScreenLocker(const UserManager::User& user) |
// http://crosbug.com/1881 |
unlock_on_input_(user_.email().empty()), |
locked_(false), |
- start_time_(base::Time::Now()) { |
+ start_time_(base::Time::Now()), |
+ throbber_manager_(new ThrobberManager) { |
DCHECK(!screen_locker_); |
screen_locker_ = this; |
} |
@@ -645,6 +647,7 @@ void ScreenLocker::Init() { |
screen_lock_view_ = new ScreenLockView(this); |
screen_lock_view_->Init(); |
screen_lock_view_->SetEnabled(false); |
+ StartThrobber(); |
Nikita (slow)
2010/12/09 15:33:22
As I understand this throbber is shown while Scree
|
} else { |
input_event_observer_.reset(new InputEventObserver(this)); |
MessageLoopForUI::current()->AddObserver(input_event_observer_.get()); |
@@ -781,6 +784,7 @@ void ScreenLocker::Authenticate(const string16& password) { |
authentication_start_time_ = base::Time::Now(); |
screen_lock_view_->SetEnabled(false); |
screen_lock_view_->SetSignoutEnabled(false); |
+ StartThrobber(); |
// If LoginPerformer instance exists, |
// initial online login phase is still active. |
@@ -809,6 +813,7 @@ void ScreenLocker::EnableInput() { |
if (screen_lock_view_) { |
screen_lock_view_->SetEnabled(true); |
screen_lock_view_->ClearAndSetFocusToPassword(); |
+ StopThrobber(); |
} |
} |
@@ -828,6 +833,7 @@ void ScreenLocker::ShowErrorMessage(const std::wstring& message, |
bool sign_out_only) { |
if (sign_out_only) { |
screen_lock_view_->SetEnabled(false); |
+ StartThrobber(); |
Nikita (slow)
2010/12/09 15:33:22
Why show throbber along with error bubble?
oshima
2010/12/09 21:52:10
may be this is a bug from http://codereview.chromi
altimofeev
2010/12/10 16:37:40
Oshima-san is right. I have automatically copied t
|
} else { |
EnableInput(); |
} |
@@ -936,6 +942,20 @@ ScreenLocker::~ScreenLocker() { |
CrosLibrary::Get()->GetScreenLockLibrary()->NotifyScreenUnlockCompleted(); |
} |
+void ScreenLocker::StartThrobber() { |
+ views::Widget* widget_under_throbber = |
+ screen_lock_view_->GetWidgetForThrobber(); |
+ if (widget_under_throbber) { |
+ throbber_manager_->StartShow(widget_under_throbber, |
+ CreateDefaultSmoothedThrobber(), |
+ login::kThrobberRightShift); |
+ } |
+} |
+ |
+void ScreenLocker::StopThrobber() { |
+ throbber_manager_->Stop(); |
+} |
+ |
void ScreenLocker::SetAuthenticator(Authenticator* authenticator) { |
authenticator_ = authenticator; |
} |