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

Unified Diff: chrome/browser/automation/automation_event_observers_chromeos.cc

Issue 10912142: [chromeos] Wait for initial page load after login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 3 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
« no previous file with comments | « chrome/browser/automation/automation_event_observers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6d45d0054b41f1811097ae8a71573cebf8271b6e 100644
--- a/chrome/browser/automation/automation_event_observers_chromeos.cc
+++ b/chrome/browser/automation/automation_event_observers_chromeos.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/automation/automation_event_observers.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/login/existing_user_controller.h"
+#include "content/public/browser/notification_service.h"
LoginEventObserver::LoginEventObserver(
AutomationEventQueue* event_queue,
@@ -32,7 +33,19 @@ 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());
+ }
}
void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) {
« no previous file with comments | « chrome/browser/automation/automation_event_observers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698