diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 2 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider_observers.cc | 13 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider_observers.h | 4 | ||||
-rw-r--r-- | chrome/browser/metrics/metrics_service.cc | 2 | ||||
-rw-r--r-- | chrome/browser/net/predictor_api.cc | 2 | ||||
-rw-r--r-- | chrome/browser/sessions/session_service.cc | 2 | ||||
-rw-r--r-- | chrome/browser/sync/glue/session_change_processor.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tabs/pinned_tab_service.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/login/login_prompt.cc | 10 |
9 files changed, 22 insertions, 17 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 6f9472e..61b0eee 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -117,7 +117,7 @@ AutomationProvider::AutomationProvider(Profile* profile) extension_tracker_.reset(new AutomationExtensionTracker(this)); tab_tracker_.reset(new AutomationTabTracker(this)); window_tracker_.reset(new AutomationWindowTracker(this)); - new_tab_ui_load_observer_.reset(new NewTabUILoadObserver(this)); + new_tab_ui_load_observer_.reset(new NewTabUILoadObserver(this, profile)); metric_event_duration_observer_.reset(new MetricEventDurationObserver()); extension_test_result_observer_.reset( new ExtensionTestResultNotificationObserver(this)); diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index ebcae77..914dfaf 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -160,10 +160,11 @@ void InitialLoadObserver::ConditionMet() { automation_->OnInitialTabLoadsComplete(); } -NewTabUILoadObserver::NewTabUILoadObserver(AutomationProvider* automation) +NewTabUILoadObserver::NewTabUILoadObserver(AutomationProvider* automation, + Profile* profile) : automation_(automation->AsWeakPtr()) { registrar_.Add(this, chrome::NOTIFICATION_INITIAL_NEW_TAB_UI_LOAD, - NotificationService::AllSources()); + Source<Profile>(profile)); } NewTabUILoadObserver::~NewTabUILoadObserver() { @@ -763,9 +764,9 @@ BrowserOpenedNotificationObserver::BrowserOpenedNotificationObserver( new_window_id_(extension_misc::kUnknownWindowId), for_browser_command_(false) { registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); } BrowserOpenedNotificationObserver::~BrowserOpenedNotificationObserver() { @@ -859,9 +860,9 @@ BrowserCountChangeNotificationObserver::BrowserCountChangeNotificationObserver( automation_(automation->AsWeakPtr()), reply_message_(reply_message) { registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); } BrowserCountChangeNotificationObserver:: diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h index 2582931..acb48e6 100644 --- a/chrome/browser/automation/automation_provider_observers.h +++ b/chrome/browser/automation/automation_provider_observers.h @@ -58,6 +58,7 @@ class Browser; class Extension; class ExtensionProcessManager; class NavigationController; +class Profile; class RenderViewHost; class SavePackage; class TabContents; @@ -134,7 +135,8 @@ class NetworkManagerInitObserver // Watches for NewTabUI page loads for performance timing purposes. class NewTabUILoadObserver : public NotificationObserver { public: - explicit NewTabUILoadObserver(AutomationProvider* automation); + explicit NewTabUILoadObserver(AutomationProvider* automation, + Profile* profile); virtual ~NewTabUILoadObserver(); virtual void Observe(int type, diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index eb540de..281905b 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -535,7 +535,7 @@ bool MetricsService::reporting_active() const { void MetricsService::SetUpNotifications(NotificationRegistrar* registrar, NotificationObserver* observer) { registrar->Add(observer, chrome::NOTIFICATION_BROWSER_OPENED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); registrar->Add(observer, chrome::NOTIFICATION_BROWSER_CLOSED, NotificationService::AllSources()); registrar->Add(observer, content::NOTIFICATION_USER_ACTION, diff --git a/chrome/browser/net/predictor_api.cc b/chrome/browser/net/predictor_api.cc index dc713f3..6eeed63 100644 --- a/chrome/browser/net/predictor_api.cc +++ b/chrome/browser/net/predictor_api.cc @@ -309,7 +309,7 @@ class OffTheRecordObserver : public NotificationObserver { registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); } } diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index feccc25..ba4a4e0 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -469,7 +469,7 @@ void SessionService::Init() { registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); registrar_.Add( this, chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, NotificationService::AllSources()); diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc index 62c3b9c..d8829bb 100644 --- a/chrome/browser/sync/glue/session_change_processor.cc +++ b/chrome/browser/sync/glue/session_change_processor.cc @@ -280,7 +280,7 @@ void SessionChangeProcessor::StartObserving() { notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, NotificationService::AllSources()); notification_registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); notification_registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, NotificationService::AllSources()); diff --git a/chrome/browser/tabs/pinned_tab_service.cc b/chrome/browser/tabs/pinned_tab_service.cc index d09f579..9f43dce 100644 --- a/chrome/browser/tabs/pinned_tab_service.cc +++ b/chrome/browser/tabs/pinned_tab_service.cc @@ -27,7 +27,7 @@ PinnedTabService::PinnedTabService(Profile* profile) got_exiting_(false), has_normal_browser_(false) { registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSING, NotificationService::AllSources()); registrar_.Add(this, content::NOTIFICATION_APP_EXITING, diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc index 2a2c790..c4c39f2 100644 --- a/chrome/browser/ui/login/login_prompt.cc +++ b/chrome/browser/ui/login/login_prompt.cc @@ -192,19 +192,21 @@ void LoginHandler::OnRequestCancelled() { void LoginHandler::AddObservers() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + // This is probably OK; we need to listen to everything and we break out of + // the Observe() if we aren't handling the same auth_info(). registrar_.Add(this, chrome::NOTIFICATION_AUTH_SUPPLIED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, chrome::NOTIFICATION_AUTH_CANCELLED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); } void LoginHandler::RemoveObservers() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); registrar_.Remove(this, chrome::NOTIFICATION_AUTH_SUPPLIED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); registrar_.Remove(this, chrome::NOTIFICATION_AUTH_CANCELLED, - NotificationService::AllSources()); + NotificationService::AllBrowserContextsAndSources()); DCHECK(registrar_.IsEmpty()); } |