Index: chrome/browser/automation/automation_event_observers_chromeos.cc |
diff --git a/chrome/browser/automation/automation_event_observers_chromeos.cc b/chrome/browser/automation/automation_event_observers_chromeos.cc |
index e3da47d840fa0fe762c7990afa36611169e63006..1aa0741f08c4a7a5b5a7069fd4fd0e164c7a47bf 100644 |
--- a/chrome/browser/automation/automation_event_observers_chromeos.cc |
+++ b/chrome/browser/automation/automation_event_observers_chromeos.cc |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "content/public/browser/notification_service.h" |
jam
2012/09/11 00:34:43
nit: order
|
#include "chrome/browser/automation/automation_event_observers.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/chromeos/login/existing_user_controller.h" |
@@ -32,9 +33,22 @@ void LoginEventObserver::OnLoginSuccess(const std::string& username, |
automation_->set_profile( |
g_browser_process->profile_manager()->GetLastUsedProfile()); |
} |
- _NotifyLoginEvent(std::string()); |
+ VLOG(1) << "Successfully logged in. Waiting for a page to load"; |
+ registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, |
+ content::NotificationService::AllBrowserContextsAndSources()); |
} |
+void LoginEventObserver::Observe( |
+ int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) { |
+ if (type == content::NOTIFICATION_LOAD_STOP) { |
+ VLOG(1) << "Page load done."; |
+ _NotifyLoginEvent(std::string()); |
+ } |
+} |
+ |
jam
2012/09/11 00:34:43
nit: extra blank line
|
+ |
void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) { |
DictionaryValue* dict = new DictionaryValue; |
dict->SetString("type", "login_event"); |