diff options
author | altimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-10 11:39:24 +0000 |
---|---|---|
committer | altimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-10 11:39:24 +0000 |
commit | 0c9506651b3bd029fa8c107c0b7e75e3fcf5d703 (patch) | |
tree | 4595755e4a50bc6ded4a510a7d22153c0bb87470 | |
parent | a1b1d5e0ddacbacdb6103c9979a59d9419cfb8e2 (diff) | |
download | chromium_src-0c9506651b3bd029fa8c107c0b7e75e3fcf5d703.zip chromium_src-0c9506651b3bd029fa8c107c0b7e75e3fcf5d703.tar.gz chromium_src-0c9506651b3bd029fa8c107c0b7e75e3fcf5d703.tar.bz2 |
Stops throbber when hiding animation is about to start.
Also fixes possible problem with white rectangle blinking when spinner
window is shown.
BUG=chromium-os:7919
TEST=manual
Review URL: http://codereview.chromium.org/6452005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74425 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed, 18 insertions, 28 deletions
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 80bba43..74afdec 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -151,8 +151,6 @@ void ExistingUserController::Init(const UserVector& users) { login_display_->set_parent_window(GetNativeWindow()); login_display_->Init(filtered_users, show_guest, show_new_user); - WmMessageListener::GetInstance()->AddObserver(this); - LoginUtils::Get()->PrewarmAuthentication(); if (CrosLibrary::Get()->EnsureLoaded()) CrosLibrary::Get()->GetLoginLibrary()->EmitLoginPromptReady(); @@ -187,25 +185,11 @@ ExistingUserController::~ExistingUserController() { if (background_window_) background_window_->Close(); - WmMessageListener::GetInstance()->RemoveObserver(this); - DCHECK(current_controller_ != NULL); current_controller_ = NULL; } //////////////////////////////////////////////////////////////////////////////// -// ExistingUserController, WmMessageListener::Observer implementation: -// - -void ExistingUserController::ProcessWmMessage(const WmIpc::Message& message, - GdkWindow* window) { - if (message.type() != WM_IPC_MESSAGE_CHROME_CREATE_GUEST_WINDOW) - return; - - ActivateWizard(std::string()); -} - -//////////////////////////////////////////////////////////////////////////////// // ExistingUserController, LoginDisplay::Delegate implementation: // @@ -393,14 +377,11 @@ void ExistingUserController::OnLoginSuccess( password, credentials, pending_requests); + ActivateWizard(WizardController::IsDeviceRegistered() ? WizardController::kUserImageScreenName : WizardController::kRegistrationScreenName); } else { - // Hide the login windows now. - WmIpc::Message message(WM_IPC_MESSAGE_WM_HIDE_LOGIN); - WmIpc::instance()->SendMessage(message); - LoginUtils::Get()->CompleteLogin(username, password, credentials, @@ -493,6 +474,8 @@ void ExistingUserController::ActivateWizard(const std::string& screen_name) { if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) controller->set_start_url(guest_mode_url_); + login_display_->OnFadeOut(); + delete_timer_.Start(base::TimeDelta::FromSeconds(1), this, &ExistingUserController::Delete); } diff --git a/chrome/browser/chromeos/login/existing_user_controller.h b/chrome/browser/chromeos/login/existing_user_controller.h index 5505704..4d737b7 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.h +++ b/chrome/browser/chromeos/login/existing_user_controller.h @@ -37,7 +37,6 @@ class UserCrosSettingsProvider; // the user logs in (or chooses to see other settings). class ExistingUserController : public LoginDisplay::Delegate, public NotificationObserver, - public WmMessageListener::Observer, public LoginPerformer::Delegate, public CaptchaView::Delegate, public PasswordChangedView::Delegate { @@ -77,10 +76,6 @@ class ExistingUserController : public LoginDisplay::Delegate, ~ExistingUserController(); - // WmMessageListener::Observer: - virtual void ProcessWmMessage(const WmIpc::Message& message, - GdkWindow* window); - // LoginPerformer::Delegate implementation: virtual void OnLoginFailure(const LoginFailure& error); virtual void OnLoginSuccess( @@ -149,7 +144,8 @@ class ExistingUserController : public LoginDisplay::Delegate, // logins for the same user. size_t num_login_attempts_; - // See comment in ProcessWmMessage. + // Timer which is used to defer deleting and gave abitility to WM to smoothly + // hide the windows. base::OneShotTimer<ExistingUserController> delete_timer_; // Pointer to the current instance of the controller to be used by diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc index 9bc47c0..999ad75 100644 --- a/chrome/browser/chromeos/login/helper.cc +++ b/chrome/browser/chromeos/login/helper.cc @@ -103,11 +103,14 @@ void ThrobberHostView::StartThrobber() { new views::WidgetGtk(views::WidgetGtk::TYPE_WINDOW); widget_gtk->make_transient_to_parent(); widget_gtk->MakeTransparent(); - throbber_widget_ = widget_gtk; + throbber_widget_ = widget_gtk; throbber_bounds.Offset(host_view_->GetScreenBounds().origin()); throbber_widget_->Init(host_gtk_window, throbber_bounds); throbber_widget_->SetContentsView(throbber); + // This keeps the window from flashing at startup. + gdk_window_set_back_pixmap( + throbber_widget_->GetNativeView()->window, NULL, false); throbber_widget_->Show(); // WM can ignore bounds before widget is shown. throbber_widget_->SetBounds(throbber_bounds); diff --git a/chrome/browser/chromeos/login/login_display.h b/chrome/browser/chromeos/login/login_display.h index f912b98..dd1e143 100644 --- a/chrome/browser/chromeos/login/login_display.h +++ b/chrome/browser/chromeos/login/login_display.h @@ -64,6 +64,10 @@ class LoginDisplay { // Called right after user removal process has been initiated. virtual void OnUserRemoved(const std::string& username) = 0; + // After this call login display should be ready to be smoothly destroyed + // (e.g. hide throbber, etc.). + virtual void OnFadeOut() = 0; + // Changes enabled state of the UI. virtual void SetUIEnabled(bool is_enabled) = 0; diff --git a/chrome/browser/chromeos/login/views_login_display.cc b/chrome/browser/chromeos/login/views_login_display.cc index 4f2da1c..b2ceb90 100644 --- a/chrome/browser/chromeos/login/views_login_display.cc +++ b/chrome/browser/chromeos/login/views_login_display.cc @@ -173,6 +173,10 @@ void ViewsLoginDisplay::OnUserRemoved(const std::string& username) { EnableTooltipsIfNeeded(controllers_); } +void ViewsLoginDisplay::OnFadeOut() { + controllers_[selected_view_index_]->StopThrobber(); +} + void ViewsLoginDisplay::SetUIEnabled(bool is_enabled) { // Send message to WM to enable/disable click on windows. WmIpc::Message message(WM_IPC_MESSAGE_WM_SET_LOGIN_STATE); diff --git a/chrome/browser/chromeos/login/views_login_display.h b/chrome/browser/chromeos/login/views_login_display.h index c8639d5..d7d66bd 100644 --- a/chrome/browser/chromeos/login/views_login_display.h +++ b/chrome/browser/chromeos/login/views_login_display.h @@ -40,6 +40,7 @@ class ViewsLoginDisplay : public LoginDisplay, virtual void OnBeforeUserRemoved(const std::string& username); virtual void OnUserImageChanged(UserManager::User* user); virtual void OnUserRemoved(const std::string& username); + virtual void OnFadeOut(); virtual void SetUIEnabled(bool is_enabled); virtual void ShowError(int error_msg_id, int login_attempts, @@ -96,4 +97,3 @@ class ViewsLoginDisplay : public LoginDisplay, } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_LOGIN_VIEWS_LOGIN_DISPLAY_H_ - |