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

Unified Diff: chrome/browser/chromeos/login/base_login_display_host.cc

Issue 9264059: Enable hide animation for login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 11 months 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/base_login_display_host.cc
diff --git a/chrome/browser/chromeos/login/base_login_display_host.cc b/chrome/browser/chromeos/login/base_login_display_host.cc
index b1a0f1d6e21bccefc9e49b09329d0f6e7790adf6..48963e5a9834091252dfaa85e85f14850c60feda 100644
--- a/chrome/browser/chromeos/login/base_login_display_host.cc
+++ b/chrome/browser/chromeos/login/base_login_display_host.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/policy/auto_enrollment_client.h"
#include "chrome/browser/policy/browser_policy_connector.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
@@ -138,6 +139,13 @@ BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds)
registrar_.Add(this,
content::NOTIFICATION_APP_EXITING,
content::NotificationService::AllSources());
+
+ // NOTIFICATION_BROWSER_OPENED is issued after browser is created, but
+ // not shown yet. Lock window has to be closed at this point so that
+ // a browser window exists and the window can acquire input focus.
+ registrar_.Add(this,
+ chrome::NOTIFICATION_BROWSER_OPENED,
+ content::NotificationService::AllSources());
DCHECK(default_host_ == NULL);
default_host_ = this;
@@ -264,8 +272,17 @@ void BaseLoginDisplayHost::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- CHECK(type == content::NOTIFICATION_APP_EXITING);
- ShutdownDisplayHost(true);
+ registrar_.RemoveAll();
+ switch (type) {
+ case content::NOTIFICATION_APP_EXITING:
+ ShutdownDisplayHost(true);
+ break;
+ case chrome::NOTIFICATION_BROWSER_OPENED:
+ OnBrowserCreated();
+ break;
+ default:
+ LOG(FATAL) << "Unknown notification type:" << type;
+ }
}
void BaseLoginDisplayHost::ShutdownDisplayHost(bool post_quit_task) {

Powered by Google App Engine
This is Rietveld 408576698