Chromium Code Reviews| Index: chrome/browser/extensions/api/tabs/tabs_event_router.h |
| diff --git a/chrome/browser/extensions/browser_event_router.h b/chrome/browser/extensions/api/tabs/tabs_event_router.h |
| similarity index 86% |
| rename from chrome/browser/extensions/browser_event_router.h |
| rename to chrome/browser/extensions/api/tabs/tabs_event_router.h |
| index 7450ccb0ab5c8c47813471a369833cea162f4a38..174c8567e10561f7583711c616ee764beb6ffdcd 100644 |
| --- a/chrome/browser/extensions/browser_event_router.h |
| +++ b/chrome/browser/extensions/api/tabs/tabs_event_router.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| -#define CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| +#ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_EVENT_ROUTER_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_EVENT_ROUTER_H_ |
| #include <map> |
| #include <string> |
| @@ -22,17 +22,16 @@ class WebContents; |
| namespace extensions { |
| -// The BrowserEventRouter listens to Browser window & tab events |
| -// and routes them to listeners inside extension process renderers. |
| -// BrowserEventRouter listens to *all* events, but will only route |
| -// events from windows/tabs within a profile to extension processes in the same |
| -// profile. |
| -class BrowserEventRouter : public TabStripModelObserver, |
| - public chrome::BrowserListObserver, |
| - public content::NotificationObserver { |
| +// The TabsEventRouter listens to tab events and routes them to listeners inside |
| +// extension process renderers. |
| +// TabsEventRouter listens to *all* events, but will only route events from |
|
Yoyo Zhou
2013/09/10 23:03:09
Delete the bit about listening to all events. It's
Devlin
2013/09/11 00:49:50
Done.
|
| +// windows/tabs within a profile to extension processes in the same profile. |
| +class TabsEventRouter : public TabStripModelObserver, |
| + public chrome::BrowserListObserver, |
| + public content::NotificationObserver { |
| public: |
| - explicit BrowserEventRouter(Profile* profile); |
| - virtual ~BrowserEventRouter(); |
| + explicit TabsEventRouter(Profile* profile); |
| + virtual ~TabsEventRouter(); |
| // chrome::BrowserListObserver |
| virtual void OnBrowserAdded(Browser* browser) OVERRIDE; |
| @@ -66,7 +65,6 @@ class BrowserEventRouter : public TabStripModelObserver, |
| int index) OVERRIDE; |
| virtual void TabPinnedStateChanged(content::WebContents* contents, |
| int index) OVERRIDE; |
| - virtual void TabStripEmpty() OVERRIDE; |
| // content::NotificationObserver. |
| virtual void Observe(int type, |
| @@ -81,11 +79,10 @@ class BrowserEventRouter : public TabStripModelObserver, |
| void TabUpdated(content::WebContents* contents, bool did_navigate); |
| // Triggers a tab updated event if the favicon URL changes. |
| - void FaviconUrlUpdated(content::WebContents* contents, |
| - const bool* icon_url_changed); |
| + void FaviconUrlUpdated(content::WebContents* contents); |
| // The DispatchEvent methods forward events to the |profile|'s event router. |
| - // The BrowserEventRouter listens to events for all profiles, |
| + // The TabsEventRouter listens to events for all profiles, |
| // so we avoid duplication by dropping events destined for other profiles. |
| void DispatchEvent(Profile* profile, |
| const char* event_name, |
| @@ -164,9 +161,9 @@ class BrowserEventRouter : public TabStripModelObserver, |
| // The main profile that owns this event router. |
| Profile* profile_; |
| - DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); |
| + DISALLOW_COPY_AND_ASSIGN(TabsEventRouter); |
| }; |
| } // namespace extensions |
| -#endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| +#endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_EVENT_ROUTER_H_ |