Chromium Code Reviews| 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..7e11da871f42018117c0f6f3b16fe07feffebbef 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 creaetd, but |
|
Nikita (slow)
2012/01/31 15:26:24
nit: created
oshima
2012/01/31 17:47:51
Done.
|
| + // 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) { |