summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/chromeos/login/existing_user_controller.cc23
-rw-r--r--chrome/browser/chromeos/login/existing_user_controller.h8
-rw-r--r--chrome/browser/chromeos/login/helper.cc5
-rw-r--r--chrome/browser/chromeos/login/login_display.h4
-rw-r--r--chrome/browser/chromeos/login/views_login_display.cc4
-rw-r--r--chrome/browser/chromeos/login/views_login_display.h2
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_
-