summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_browser_event_router.h
diff options
context:
space:
mode:
authoryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-23 00:41:13 +0000
committeryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-23 00:41:13 +0000
commit0a184b5d3f485ffeb672754b0855a7fe80d87db6 (patch)
tree0140d5ce56f38eaeb661cb9b0dfa9ce07ebe0bf6 /chrome/browser/extensions/extension_browser_event_router.h
parentca87a0334160f3fa810c76a26b7c0191377e50b2 (diff)
downloadchromium_src-0a184b5d3f485ffeb672754b0855a7fe80d87db6.zip
chromium_src-0a184b5d3f485ffeb672754b0855a7fe80d87db6.tar.gz
chromium_src-0a184b5d3f485ffeb672754b0855a7fe80d87db6.tar.bz2
More correct window focus changes for multi-profile and incognito.
Multi-profile: treat windows from other profiles as WINDOW_ID_NONE. Incognito: on switching between default/OTR profile windows, send WINDOW_ID_NONE to the extensions that can't see the new window. Also make ExtensionBrowserEventRouter listen only to events from browsers and tabs for its profile, except for window focus events. BUG=46610, 57186, 86001 TEST=Manually tested extensions in spanning and split mode. Review URL: http://codereview.chromium.org/7187015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90143 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_browser_event_router.h')
-rw-r--r--chrome/browser/extensions/extension_browser_event_router.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_browser_event_router.h b/chrome/browser/extensions/extension_browser_event_router.h
index 6136f6e..eda06a6 100644
--- a/chrome/browser/extensions/extension_browser_event_router.h
+++ b/chrome/browser/extensions/extension_browser_event_router.h
@@ -115,6 +115,11 @@ class ExtensionBrowserEventRouter : public TabStripModelObserver,
const char* event_name,
const std::string& json_args);
+ void DispatchEventsAcrossIncognito(Profile* profile,
+ const char* event_name,
+ const std::string& json_args,
+ const std::string& cross_incognito_args);
+
void DispatchEventWithTab(Profile* profile,
const std::string& extension_id,
const char* event_name,
@@ -196,14 +201,18 @@ class ExtensionBrowserEventRouter : public TabStripModelObserver,
std::map<int, TabEntry> tab_entries_;
+ // The main profile that owns this event router.
+ Profile* profile_;
+
+ // The profile the currently focused window belongs to; either the main or
+ // incognito profile or NULL (none of the above). We remember this in order
+ // to correctly handle focus changes between non-OTR and OTR windows.
+ Profile* focused_profile_;
+
// The currently focused window. We keep this so as to avoid sending multiple
// windows.onFocusChanged events with the same windowId.
int focused_window_id_;
- // The main profile (non-OTR) profile which will be used to send events not
- // associated with any browser.
- Profile* profile_;
-
DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserEventRouter);
};