Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/browser/extensions/extension_panel_event_router.h

Issue 10777004: Support chrome.windows extension API events for browserless Panels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac unit_test failure Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PANEL_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PANEL_EVENT_ROUTER_H_
7
8 #include "base/basictypes.h"
9
10 class Panel;
11 class Profile;
12
13 namespace base {
14 class ListValue;
15 }
16
17 // The ExtensinoPanelEventRouter sends Panel window events
Mihai Parparita -not on Chrome 2012/07/19 20:14:58 Typo ("Extensino")
18 // to listeners inside extension process renderers.
19 class ExtensionPanelEventRouter {
Mihai Parparita -not on Chrome 2012/07/19 20:14:58 In light of http://crrev.com/147083, this perhaps
stevenjb 2012/07/20 16:54:33 I think this should be extensions::PanelEventRoute
jennb 2012/07/20 18:09:37 I propose creating extension::WindowEventRouter (t
stevenjb 2012/07/20 18:26:14 That sounds great to me, thanks!
20 public:
21 explicit ExtensionPanelEventRouter(Profile* profile);
22 virtual ~ExtensionPanelEventRouter();
23
24 // Sends corresponding events to listeners in extension process renderers.
25 void OnPanelOpened(Panel* panel);
26 void OnPanelActiveStatusChanged(Panel* panel, bool is_active_now);
27 void OnPanelClosed(Panel* panel);
28
29 private:
30 void DispatchEvent(const char* event_name,
31 Profile* profile,
32 base::ListValue* args);
33
34 // The main profile that owns this event router.
35 Profile* profile_;
36
37 // The profile the currently focused panel belongs to; either the main or
38 // incognito profile or NULL (none of the above). We remember this in order
39 // to correctly handle focus changes between non-OTR and OTR panels.
40 Profile* focused_profile_;
41
42 // The currently focused panel. We keep this so as to avoid sending multiple
43 // windows.onFocusChanged events with the same windowId.
44 int focused_window_id_;
45
46 DISALLOW_COPY_AND_ASSIGN(ExtensionPanelEventRouter);
47 };
48
49 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PANEL_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698