diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 02:27:51 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 02:27:51 +0000 |
commit | 12bc9314be7c075516ce92ca1711669d3d5aa892 (patch) | |
tree | 3ab35c2eec844f06fd82bc8acb8a632fc6ff2541 /chrome | |
parent | 14f986e2173cba9b850b65fb00dca74e7db3f76e (diff) | |
download | chromium_src-12bc9314be7c075516ce92ca1711669d3d5aa892.zip chromium_src-12bc9314be7c075516ce92ca1711669d3d5aa892.tar.gz chromium_src-12bc9314be7c075516ce92ca1711669d3d5aa892.tar.bz2 |
Revert "Revert "Use a NotificationRegistrar to listen for notifications.""
This re-applies r16709.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_accessibility_manager.cc | 8 | ||||
-rw-r--r-- | chrome/browser/browser_accessibility_manager.h | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/browser_accessibility_manager.cc b/chrome/browser/browser_accessibility_manager.cc index 0930024..5190870 100644 --- a/chrome/browser/browser_accessibility_manager.cc +++ b/chrome/browser/browser_accessibility_manager.cc @@ -22,17 +22,13 @@ BrowserAccessibilityManager* BrowserAccessibilityManager::GetInstance() { } BrowserAccessibilityManager::BrowserAccessibilityManager() { - NotificationService::current()->AddObserver(this, - NotificationType::RENDERER_PROCESS_TERMINATED, - NotificationService::AllSources()); + registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED, + NotificationService::AllSources()); } BrowserAccessibilityManager::~BrowserAccessibilityManager() { // Clear hashmap. render_process_host_map_.clear(); - - // We don't remove ourselves as an observer because we are a Singleton object, - // and NotifcationService is likely gone by this point. } STDMETHODIMP BrowserAccessibilityManager::CreateAccessibilityInstance( diff --git a/chrome/browser/browser_accessibility_manager.h b/chrome/browser/browser_accessibility_manager.h index 081f978..4af1363 100644 --- a/chrome/browser/browser_accessibility_manager.h +++ b/chrome/browser/browser_accessibility_manager.h @@ -8,7 +8,7 @@ #include <map> #include "base/singleton.h" -#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" #include "webkit/glue/webaccessibility.h" class BrowserAccessibility; @@ -81,6 +81,8 @@ class BrowserAccessibilityManager : public NotificationObserver { typedef std::multimap<int, BrowserAccessibility*> RenderProcessHostMap; typedef std::pair<int, BrowserAccessibility*> MapEntry; + NotificationRegistrar registrar_; + // Mapping to track which RenderProcessHosts ids are active. If a // RenderProcessHost is found to be terminated, its id (key) should be removed // from this mapping, and the connected BrowserAccessibility ids/instances |