Chromium Code Reviews| 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..4244979c4066905e4a28f482bd20e98216cf1a34 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" |
| #include "chrome/browser/automation/automation_event_observers.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| @@ -14,6 +15,8 @@ LoginEventObserver::LoginEventObserver( |
| controller_(controller), |
| automation_(automation->AsWeakPtr()) { |
| controller_->set_login_status_consumer(this); |
| + registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, |
| + content::NotificationService::AllBrowserContextsAndSources()); |
| } |
| LoginEventObserver::~LoginEventObserver() {} |
| @@ -32,9 +35,18 @@ void LoginEventObserver::OnLoginSuccess(const std::string& username, |
| automation_->set_profile( |
| g_browser_process->profile_manager()->GetLastUsedProfile()); |
| } |
|
craigdh
2012/09/07 16:30:05
Log that the login success event occurred (this co
Nirnimesh
2012/09/11 00:28:20
Done.
|
| - _NotifyLoginEvent(std::string()); |
| } |
| +void LoginEventObserver::Observe( |
| + int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) { |
| + if (type == content::NOTIFICATION_LOAD_STOP) { |
| + _NotifyLoginEvent(std::string()); |
| + } |
| +} |
| + |
| + |
| void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) { |
| DictionaryValue* dict = new DictionaryValue; |
| dict->SetString("type", "login_event"); |