Chromium Code Reviews| Index: chrome/browser/extensions/api/tabs/windows_event_router.h |
| diff --git a/chrome/browser/extensions/api/tabs/windows_event_router.h b/chrome/browser/extensions/api/tabs/windows_event_router.h |
| index 1f87493f4ac6dd2c488f283ef3427b92873ec074..c83b94c16fd480dca404166d0883a5be2ebacae8 100644 |
| --- a/chrome/browser/extensions/api/tabs/windows_event_router.h |
| +++ b/chrome/browser/extensions/api/tabs/windows_event_router.h |
| @@ -5,13 +5,16 @@ |
| #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_EVENT_ROUTER_H_ |
| #define CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_EVENT_ROUTER_H_ |
| +#include <map> |
| #include <string> |
| #include "base/basictypes.h" |
| +#include "base/containers/scoped_ptr_hash_map.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "chrome/browser/extensions/window_controller_list_observer.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| +#include "extensions/browser/app_window/app_window_registry.h" |
| #if !defined(OS_MACOSX) |
| #include "ui/views/focus/widget_focus_manager.h" |
| @@ -25,19 +28,29 @@ class ListValue; |
| namespace extensions { |
| +class AppWindow; |
| +class AppWindowController; |
| + |
| // The WindowsEventRouter sends chrome.windows.* events to listeners |
| // inside extension process renderers. The router listens to *all* events, |
| // but will only route events within a profile to extension processes in the |
| // same profile. |
| -class WindowsEventRouter : public WindowControllerListObserver, |
| +class WindowsEventRouter : public AppWindowRegistry::Observer, |
| + public WindowControllerListObserver, |
| #if !defined(OS_MACOSX) |
| - public views::WidgetFocusChangeListener, |
| + public views::WidgetFocusChangeListener, |
| #endif |
| - public content::NotificationObserver { |
| + public content::NotificationObserver { |
| public: |
| explicit WindowsEventRouter(Profile* profile); |
| ~WindowsEventRouter() override; |
| + void DispatchEvents(); |
|
dcheng
2015/06/29 18:15:49
The name of this member makes it sound like this a
llandwerlin-old
2015/06/30 10:20:47
Done.
|
| + |
| + // extensions::AppWindowRegistry::Observer: |
| + void OnAppWindowAdded(extensions::AppWindow* app_window) override; |
| + void OnAppWindowRemoved(extensions::AppWindow* app_window) override; |
| + |
| // WindowControllerListObserver methods: |
| void OnWindowControllerAdded(WindowController* window_controller) override; |
| void OnWindowControllerRemoved(WindowController* window) override; |
| @@ -73,6 +86,12 @@ class WindowsEventRouter : public WindowControllerListObserver, |
| // windows.onFocusChanged events with the same windowId. |
| int focused_window_id_; |
| + // Whether to dispatch events. |
| + bool dispatch_events_; |
| + |
| + // Map of application windows. |
| + base::ScopedPtrHashMap<int, scoped_ptr<AppWindowController>> app_windows_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(WindowsEventRouter); |
| }; |