diff options
14 files changed, 126 insertions, 180 deletions
diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.cc b/chrome/browser/chromeos/extensions/file_browser_event_router.cc index d4fb184..121cd7c 100644 --- a/chrome/browser/chromeos/extensions/file_browser_event_router.cc +++ b/chrome/browser/chromeos/extensions/file_browser_event_router.cc @@ -55,36 +55,32 @@ DictionaryValue* DiskToDictionaryValue( return result; } -ExtensionFileBrowserEventRouter::ExtensionFileBrowserEventRouter() +ExtensionFileBrowserEventRouter::ExtensionFileBrowserEventRouter( + Profile* profile) : delegate_(new ExtensionFileBrowserEventRouter::FileWatcherDelegate()), - profile_(NULL) { + profile_(profile) { } ExtensionFileBrowserEventRouter::~ExtensionFileBrowserEventRouter() { DCHECK(file_watchers_.empty()); STLDeleteValues(&file_watchers_); - if (!profile_) + if (!profile_) { + NOTREACHED(); return; + } if (!chromeos::CrosLibrary::Get()->EnsureLoaded()) return; chromeos::MountLibrary* lib = chromeos::CrosLibrary::Get()->GetMountLibrary(); lib->RemoveObserver(this); - profile_ = NULL; -} - -// static -ExtensionFileBrowserEventRouter* - ExtensionFileBrowserEventRouter::GetInstance() { - return Singleton<ExtensionFileBrowserEventRouter>::get(); } -void ExtensionFileBrowserEventRouter::ObserveFileSystemEvents( - Profile* profile) { - if (!profile) +void ExtensionFileBrowserEventRouter::Init() { + if (!profile_) { + NOTREACHED(); return; - profile_ = profile; + } if (!chromeos::CrosLibrary::Get()->EnsureLoaded()) return; if (chromeos::UserManager::Get()->user_is_logged_in()) { @@ -133,17 +129,6 @@ void ExtensionFileBrowserEventRouter::RemoveFileWatch( } } -void ExtensionFileBrowserEventRouter::StopObservingFileSystemEvents() { - if (!profile_) - return; - if (!chromeos::CrosLibrary::Get()->EnsureLoaded()) - return; - chromeos::MountLibrary* lib = - chromeos::CrosLibrary::Get()->GetMountLibrary(); - lib->RemoveObserver(this); - profile_ = NULL; -} - void ExtensionFileBrowserEventRouter::DiskChanged( chromeos::MountLibraryEventType event, const chromeos::MountLibrary::Disk* disk) { diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.h b/chrome/browser/chromeos/extensions/file_browser_event_router.h index ebe4eba..71f9719 100644 --- a/chrome/browser/chromeos/extensions/file_browser_event_router.h +++ b/chrome/browser/chromeos/extensions/file_browser_event_router.h @@ -28,12 +28,10 @@ class SystemNotification; class ExtensionFileBrowserEventRouter : public chromeos::MountLibrary::Observer { public: - static ExtensionFileBrowserEventRouter* GetInstance(); + explicit ExtensionFileBrowserEventRouter(Profile* profile); + virtual ~ExtensionFileBrowserEventRouter(); - // Starts/stops observing file system change events. Currently only - // MountLibrary events are being observed. - void ObserveFileSystemEvents(Profile* profile); - void StopObservingFileSystemEvents(); + void Init(); // File watch setup routines. bool AddFileWatch(const FilePath& file_path, @@ -49,7 +47,6 @@ class ExtensionFileBrowserEventRouter const std::string& device_path); private: - friend struct DefaultSingletonTraits<ExtensionFileBrowserEventRouter>; typedef std::map<std::string, linked_ptr<chromeos::SystemNotification> > NotificationMap; typedef std::map<std::string, std::string> MountPointMap; @@ -80,9 +77,6 @@ class ExtensionFileBrowserEventRouter void HandleFileWatchOnUIThread(const FilePath& local_path, bool got_error); }; - ExtensionFileBrowserEventRouter(); - virtual ~ExtensionFileBrowserEventRouter(); - // USB mount event handlers. void OnDiskAdded(const chromeos::MountLibrary::Disk* disk); void OnDiskRemoved(const chromeos::MountLibrary::Disk* disk); diff --git a/chrome/browser/extensions/extension_bookmarks_module.cc b/chrome/browser/extensions/extension_bookmarks_module.cc index e325aa0..c61c8dd 100644 --- a/chrome/browser/extensions/extension_bookmarks_module.cc +++ b/chrome/browser/extensions/extension_bookmarks_module.cc @@ -118,22 +118,18 @@ void BookmarksFunction::Observe(NotificationType type, Release(); // Balanced in Run(). } -// static -ExtensionBookmarkEventRouter* ExtensionBookmarkEventRouter::GetInstance() { - return Singleton<ExtensionBookmarkEventRouter>::get(); -} - -ExtensionBookmarkEventRouter::ExtensionBookmarkEventRouter() { +ExtensionBookmarkEventRouter::ExtensionBookmarkEventRouter( + BookmarkModel* model) : model_(model) { } ExtensionBookmarkEventRouter::~ExtensionBookmarkEventRouter() { + if (model_) { + model_->RemoveObserver(this); + } } -void ExtensionBookmarkEventRouter::Observe(BookmarkModel* model) { - if (models_.find(model) == models_.end()) { - model->AddObserver(this); - models_.insert(model); - } +void ExtensionBookmarkEventRouter::Init() { + model_->AddObserver(this); } void ExtensionBookmarkEventRouter::DispatchEvent(Profile *profile, @@ -150,6 +146,11 @@ void ExtensionBookmarkEventRouter::Loaded(BookmarkModel* model) { // so they know when it's safe to use the API? } +void ExtensionBookmarkEventRouter::BookmarkModelBeingDeleted( + BookmarkModel* model) { + model_ = NULL; +} + void ExtensionBookmarkEventRouter::BookmarkNodeMoved( BookmarkModel* model, const BookmarkNode* old_parent, diff --git a/chrome/browser/extensions/extension_bookmarks_module.h b/chrome/browser/extensions/extension_bookmarks_module.h index 48be1b7..079656e 100644 --- a/chrome/browser/extensions/extension_bookmarks_module.h +++ b/chrome/browser/extensions/extension_bookmarks_module.h @@ -12,7 +12,6 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" -#include "base/memory/singleton.h" #include "chrome/browser/bookmarks/bookmark_model_observer.h" #include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/ui/shell_dialogs.h" @@ -25,16 +24,14 @@ class FilePath; // the extension system. class ExtensionBookmarkEventRouter : public BookmarkModelObserver { public: - static ExtensionBookmarkEventRouter* GetInstance(); + explicit ExtensionBookmarkEventRouter(BookmarkModel* model); virtual ~ExtensionBookmarkEventRouter(); - // Call this for each model to observe. Safe to call multiple times per - // model. - void Observe(BookmarkModel* model); + void Init(); // BookmarkModelObserver: virtual void Loaded(BookmarkModel* model) OVERRIDE; - virtual void BookmarkModelBeingDeleted(BookmarkModel* model) OVERRIDE {} + virtual void BookmarkModelBeingDeleted(BookmarkModel* model) OVERRIDE; virtual void BookmarkNodeMoved(BookmarkModel* model, const BookmarkNode* old_parent, int old_index, @@ -57,18 +54,12 @@ class ExtensionBookmarkEventRouter : public BookmarkModelObserver { virtual void BookmarkImportEnding(BookmarkModel* model) OVERRIDE; private: - ExtensionBookmarkEventRouter(); - friend struct DefaultSingletonTraits<ExtensionBookmarkEventRouter>; - // Helper to actually dispatch an event to extension listeners. void DispatchEvent(Profile* profile, const char* event_name, const std::string& json_args); - // These are stored so that Observe can be called multiple times safely. - // This way the caller doesn't have to know whether it's already observing - // a particular model or not. The pointers are not owned by this object. - std::set<BookmarkModel*> models_; + BookmarkModel* model_; DISALLOW_COPY_AND_ASSIGN(ExtensionBookmarkEventRouter); }; diff --git a/chrome/browser/extensions/extension_cookies_api.cc b/chrome/browser/extensions/extension_cookies_api.cc index 83c535d..a7915b4 100644 --- a/chrome/browser/extensions/extension_cookies_api.cc +++ b/chrome/browser/extensions/extension_cookies_api.cc @@ -25,16 +25,18 @@ namespace keys = extension_cookies_api_constants; -// static -ExtensionCookiesEventRouter* ExtensionCookiesEventRouter::GetInstance() { - return Singleton<ExtensionCookiesEventRouter>::get(); -} +ExtensionCookiesEventRouter::ExtensionCookiesEventRouter() {} + +ExtensionCookiesEventRouter::~ExtensionCookiesEventRouter() {} -void ExtensionCookiesEventRouter::Init() { +void ExtensionCookiesEventRouter::ObserveProfile(Profile* profile) { if (registrar_.IsEmpty()) { registrar_.Add(this, NotificationType::COOKIE_CHANGED, - NotificationService::AllSources()); + Source<Profile>(profile)); + registrar_.Add(this, + NotificationType::COOKIE_CHANGED, + Source<Profile>(profile->GetOffTheRecordProfile())); } } diff --git a/chrome/browser/extensions/extension_cookies_api.h b/chrome/browser/extensions/extension_cookies_api.h index 286c8ba..50fb0c6 100644 --- a/chrome/browser/extensions/extension_cookies_api.h +++ b/chrome/browser/extensions/extension_cookies_api.h @@ -12,7 +12,6 @@ #include <string> #include "base/memory/ref_counted.h" -#include "base/memory/singleton.h" #include "base/time.h" #include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/net/chrome_cookie_notification_details.h" @@ -31,17 +30,12 @@ class URLRequestContextGetter; // extension system. class ExtensionCookiesEventRouter : public NotificationObserver { public: - // Single instance of the event router. - static ExtensionCookiesEventRouter* GetInstance(); + explicit ExtensionCookiesEventRouter(); + virtual ~ExtensionCookiesEventRouter(); - void Init(); + void ObserveProfile(Profile* profile); private: - friend struct DefaultSingletonTraits<ExtensionCookiesEventRouter>; - - ExtensionCookiesEventRouter() {} - virtual ~ExtensionCookiesEventRouter() {} - // NotificationObserver implementation. virtual void Observe(NotificationType type, const NotificationSource& source, diff --git a/chrome/browser/extensions/extension_history_api.cc b/chrome/browser/extensions/extension_history_api.cc index 9ead422..ea36ecd 100644 --- a/chrome/browser/extensions/extension_history_api.cc +++ b/chrome/browser/extensions/extension_history_api.cc @@ -64,49 +64,37 @@ void AddVisitNode(const history::VisitRow& row, ListValue* list) { } // namespace -ExtensionHistoryEventRouter* ExtensionHistoryEventRouter::GetInstance() { - return Singleton<ExtensionHistoryEventRouter>::get(); -} +ExtensionHistoryEventRouter::ExtensionHistoryEventRouter() {} + +ExtensionHistoryEventRouter::~ExtensionHistoryEventRouter() {} void ExtensionHistoryEventRouter::ObserveProfile(Profile* profile) { NotificationSource source = Source<Profile>(profile); - if (profiles_.find(source.map_key()) == profiles_.end()) - profiles_[source.map_key()] = profile; - - if (registrar_.IsEmpty()) { - registrar_.Add(this, - NotificationType::HISTORY_URL_VISITED, - NotificationService::AllSources()); - registrar_.Add(this, - NotificationType::HISTORY_URLS_DELETED, - NotificationService::AllSources()); - } + CHECK(registrar_.IsEmpty()); + registrar_.Add(this, + NotificationType::HISTORY_URL_VISITED, + source); + registrar_.Add(this, + NotificationType::HISTORY_URLS_DELETED, + source); } -ExtensionHistoryEventRouter::ExtensionHistoryEventRouter() {} - -ExtensionHistoryEventRouter::~ExtensionHistoryEventRouter() {} - void ExtensionHistoryEventRouter::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - ProfileMap::iterator it = profiles_.find(source.map_key()); - if (it != profiles_.end()) { - Profile* profile = it->second; - switch (type.value) { - case NotificationType::HISTORY_URL_VISITED: - HistoryUrlVisited( - profile, - Details<const history::URLVisitedDetails>(details).ptr()); - break; - case NotificationType::HISTORY_URLS_DELETED: - HistoryUrlsRemoved( - profile, - Details<const history::URLsDeletedDetails>(details).ptr()); - break; - default: - NOTREACHED(); - } + switch (type.value) { + case NotificationType::HISTORY_URL_VISITED: + HistoryUrlVisited( + Source<Profile>(source).ptr(), + Details<const history::URLVisitedDetails>(details).ptr()); + break; + case NotificationType::HISTORY_URLS_DELETED: + HistoryUrlsRemoved( + Source<Profile>(source).ptr(), + Details<const history::URLsDeletedDetails>(details).ptr()); + break; + default: + NOTREACHED(); } } diff --git a/chrome/browser/extensions/extension_history_api.h b/chrome/browser/extensions/extension_history_api.h index f6ddcdc..bb6f55a 100644 --- a/chrome/browser/extensions/extension_history_api.h +++ b/chrome/browser/extensions/extension_history_api.h @@ -6,10 +6,8 @@ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_ #pragma once -#include <map> #include <string> -#include "base/memory/singleton.h" #include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/history_notifications.h" @@ -19,18 +17,12 @@ // extension system. class ExtensionHistoryEventRouter : public NotificationObserver { public: - // Single instance of the event router. - static ExtensionHistoryEventRouter* GetInstance(); + explicit ExtensionHistoryEventRouter(); + virtual ~ExtensionHistoryEventRouter(); - // Safe to call multiple times. void ObserveProfile(Profile* profile); private: - friend struct DefaultSingletonTraits<ExtensionHistoryEventRouter>; - - ExtensionHistoryEventRouter(); - virtual ~ExtensionHistoryEventRouter(); - // NotificationObserver::Observe. virtual void Observe(NotificationType type, const NotificationSource& source, @@ -49,10 +41,6 @@ class ExtensionHistoryEventRouter : public NotificationObserver { // Used for tracking registrations to history service notifications. NotificationRegistrar registrar_; - // Registered profiles. - typedef std::map<uintptr_t, Profile*> ProfileMap; - ProfileMap profiles_; - DISALLOW_COPY_AND_ASSIGN(ExtensionHistoryEventRouter); }; diff --git a/chrome/browser/extensions/extension_management_api.cc b/chrome/browser/extensions/extension_management_api.cc index b67b03f..7cc38ba 100644 --- a/chrome/browser/extensions/extension_management_api.cc +++ b/chrome/browser/extensions/extension_management_api.cc @@ -250,16 +250,11 @@ bool UninstallFunction::RunImpl() { return true; } -// static -ExtensionManagementEventRouter* ExtensionManagementEventRouter::GetInstance() { - return Singleton<ExtensionManagementEventRouter>::get(); -} - ExtensionManagementEventRouter::ExtensionManagementEventRouter() {} ExtensionManagementEventRouter::~ExtensionManagementEventRouter() {} -void ExtensionManagementEventRouter::Init() { +void ExtensionManagementEventRouter::ObserveProfile(Profile* profile) { NotificationType::Type types[] = { NotificationType::EXTENSION_INSTALLED, NotificationType::EXTENSION_UNINSTALLED, @@ -267,13 +262,14 @@ void ExtensionManagementEventRouter::Init() { NotificationType::EXTENSION_UNLOADED }; - // Don't re-init (eg in the case of multiple profiles). - if (registrar_.IsEmpty()) { - for (size_t i = 0; i < arraysize(types); i++) { - registrar_.Add(this, - types[i], - NotificationService::AllSources()); - } + CHECK(registrar_.IsEmpty()); + for (size_t i = 0; i < arraysize(types); i++) { + registrar_.Add(this, + types[i], + Source<Profile>(profile)); + registrar_.Add(this, + types[i], + Source<Profile>(profile->GetOffTheRecordProfile())); } } diff --git a/chrome/browser/extensions/extension_management_api.h b/chrome/browser/extensions/extension_management_api.h index 04b2c8c..20465c0 100644 --- a/chrome/browser/extensions/extension_management_api.h +++ b/chrome/browser/extensions/extension_management_api.h @@ -6,7 +6,6 @@ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ #pragma once -#include "base/memory/singleton.h" #include "chrome/browser/extensions/extension_function.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" @@ -50,18 +49,12 @@ class UninstallFunction : public ExtensionManagementFunction { class ExtensionManagementEventRouter : public NotificationObserver { public: - // Get the singleton instance of the event router. - static ExtensionManagementEventRouter* GetInstance(); - - // Performs one-time initialization of our singleton. - void Init(); - - private: - friend struct DefaultSingletonTraits<ExtensionManagementEventRouter>; - ExtensionManagementEventRouter(); virtual ~ExtensionManagementEventRouter(); + void ObserveProfile(Profile* profile); + + private: // NotificationObserver implementation. virtual void Observe(NotificationType type, const NotificationSource& source, diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index a8973f6..1a65255 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -645,35 +645,34 @@ ExtensionService::~ExtensionService() { ExternalExtensionProviderInterface* provider = i->get(); provider->ServiceShutdown(); } - -#if defined(OS_CHROMEOS) - if (event_routers_initialized_) { - ExtensionFileBrowserEventRouter::GetInstance()-> - StopObservingFileSystemEvents(); - } -#endif } void ExtensionService::InitEventRouters() { if (event_routers_initialized_) return; - ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_); + history_event_router_.reset(new ExtensionHistoryEventRouter()); + history_event_router_->ObserveProfile(profile_); ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); browser_event_router_->Init(); preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_)); - ExtensionBookmarkEventRouter::GetInstance()->Observe( - profile_->GetBookmarkModel()); - ExtensionCookiesEventRouter::GetInstance()->Init(); - ExtensionManagementEventRouter::GetInstance()->Init(); + bookmark_event_router_.reset(new ExtensionBookmarkEventRouter( + profile_->GetBookmarkModel())); + bookmark_event_router_->Init(); + cookies_event_router_.reset(new ExtensionCookiesEventRouter()); + cookies_event_router_->ObserveProfile(profile_); + management_event_router_.reset(new ExtensionManagementEventRouter()); + management_event_router_->ObserveProfile(profile_); ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); - ExtensionWebNavigationEventRouter::GetInstance()->Init(); + web_navigation_event_router_.reset( + new ExtensionWebNavigationEventRouter(profile_)); + web_navigation_event_router_->Init(); #if defined(OS_CHROMEOS) - ExtensionFileBrowserEventRouter::GetInstance()->ObserveFileSystemEvents( - profile_); - ExtensionMediaPlayerEventRouter::GetInstance()->Init(profile_); + file_browser_event_router_.reset( + new ExtensionFileBrowserEventRouter(profile_)); + file_browser_event_router_->Init(); #endif #if defined(OS_CHROMEOS) && defined(TOUCH_UI) diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index 7aae4ec..83ae397 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -39,14 +39,20 @@ #include "content/common/property_bag.h" class CrxInstaller; +class ExtensionBookmarkEventRouter; class ExtensionBrowserEventRouter; class ExtensionContentSettingsStore; +class ExtensionCookiesEventRouter; +class ExtensionFileBrowserEventRouter; +class ExtensionHistoryEventRouter; class ExtensionInstallUI; +class ExtensionManagementEventRouter; class ExtensionPreferenceEventRouter; class ExtensionServiceBackend; struct ExtensionSyncData; class ExtensionToolbarModel; class ExtensionUpdater; +class ExtensionWebNavigationEventRouter; class GURL; class PendingExtensionManager; class Profile; @@ -697,10 +703,24 @@ class ExtensionService // Flag to make sure event routers are only initialized once. bool event_routers_initialized_; + scoped_ptr<ExtensionHistoryEventRouter> history_event_router_; + scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_; scoped_ptr<ExtensionPreferenceEventRouter> preference_event_router_; + scoped_ptr<ExtensionBookmarkEventRouter> bookmark_event_router_; + + scoped_ptr<ExtensionCookiesEventRouter> cookies_event_router_; + + scoped_ptr<ExtensionManagementEventRouter> management_event_router_; + + scoped_ptr<ExtensionWebNavigationEventRouter> web_navigation_event_router_; + +#if defined(OS_CHROMEOS) + scoped_ptr<ExtensionFileBrowserEventRouter> file_browser_event_router_; +#endif + // A collection of external extension providers. Each provider reads // a source of external extension information. Examples include the // windows registry and external_extensions.json. diff --git a/chrome/browser/extensions/extension_webnavigation_api.cc b/chrome/browser/extensions/extension_webnavigation_api.cc index 04da675..513760e 100644 --- a/chrome/browser/extensions/extension_webnavigation_api.cc +++ b/chrome/browser/extensions/extension_webnavigation_api.cc @@ -247,16 +247,11 @@ void FrameNavigationState::RemoveTabContentsState( // ExtensionWebNavigtionEventRouter ------------------------------------------- -ExtensionWebNavigationEventRouter::ExtensionWebNavigationEventRouter() {} +ExtensionWebNavigationEventRouter::ExtensionWebNavigationEventRouter( + Profile* profile) : profile_(profile) {} ExtensionWebNavigationEventRouter::~ExtensionWebNavigationEventRouter() {} -// static -ExtensionWebNavigationEventRouter* -ExtensionWebNavigationEventRouter::GetInstance() { - return Singleton<ExtensionWebNavigationEventRouter>::get(); -} - void ExtensionWebNavigationEventRouter::Init() { if (registrar_.IsEmpty()) { registrar_.Add(this, @@ -284,10 +279,12 @@ void ExtensionWebNavigationEventRouter::Observe( void ExtensionWebNavigationEventRouter::CreatingNewWindow( TabContents* tab_contents, const ViewHostMsg_CreateWindow_Params* details) { - DispatchOnBeforeRetarget(tab_contents, - tab_contents->profile(), - details->opener_url, - details->target_url); + if (profile_->IsSameProfile(tab_contents->profile())) { + DispatchOnBeforeRetarget(tab_contents, + tab_contents->profile(), + details->opener_url, + details->target_url); + } } diff --git a/chrome/browser/extensions/extension_webnavigation_api.h b/chrome/browser/extensions/extension_webnavigation_api.h index 9f475dc..431507d 100644 --- a/chrome/browser/extensions/extension_webnavigation_api.h +++ b/chrome/browser/extensions/extension_webnavigation_api.h @@ -12,8 +12,8 @@ #include <map> -#include "base/memory/singleton.h" #include "chrome/browser/extensions/extension_function.h" +#include "chrome/browser/profiles/profile.h" #include "content/browser/tab_contents/tab_contents_observer.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" @@ -132,19 +132,14 @@ class ExtensionWebNavigationTabObserver : public TabContentsObserver { // system. class ExtensionWebNavigationEventRouter : public NotificationObserver { public: - // Returns the singleton instance of the event router. - static ExtensionWebNavigationEventRouter* GetInstance(); + explicit ExtensionWebNavigationEventRouter(Profile* profile); + virtual ~ExtensionWebNavigationEventRouter(); // Invoked by the extensions service once the extension system is fully set // up and can start dispatching events to extensions. void Init(); private: - friend struct DefaultSingletonTraits<ExtensionWebNavigationEventRouter>; - - ExtensionWebNavigationEventRouter(); - virtual ~ExtensionWebNavigationEventRouter(); - // NotificationObserver implementation. virtual void Observe(NotificationType type, const NotificationSource& source, @@ -159,6 +154,9 @@ class ExtensionWebNavigationEventRouter : public NotificationObserver { // Used for tracking registrations to navigation notifications. NotificationRegistrar registrar_; + // The profile that owns us via ExtensionService. + Profile* profile_; + DISALLOW_COPY_AND_ASSIGN(ExtensionWebNavigationEventRouter); }; |