From 0a184b5d3f485ffeb672754b0855a7fe80d87db6 Mon Sep 17 00:00:00 2001 From: "yoz@chromium.org" Date: Thu, 23 Jun 2011 00:41:13 +0000 Subject: 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 --- chrome/browser/extensions/extension_menu_manager_unittest.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'chrome/browser/extensions/extension_menu_manager_unittest.cc') diff --git a/chrome/browser/extensions/extension_menu_manager_unittest.cc b/chrome/browser/extensions/extension_menu_manager_unittest.cc index cfe2009..fff6f91 100644 --- a/chrome/browser/extensions/extension_menu_manager_unittest.cc +++ b/chrome/browser/extensions/extension_menu_manager_unittest.cc @@ -345,10 +345,11 @@ class MockExtensionEventRouter : public ExtensionEventRouter { explicit MockExtensionEventRouter(Profile* profile) : ExtensionEventRouter(profile) {} - MOCK_METHOD5(DispatchEventImpl, void(const std::string& extension_id, + MOCK_METHOD6(DispatchEventImpl, void(const std::string& extension_id, const std::string& event_name, const std::string& event_args, Profile* source_profile, + const std::string& cross_incognito_args, const GURL& event_url)); private: @@ -438,7 +439,7 @@ TEST_F(ExtensionMenuManagerTest, ExecuteCommand) { .WillOnce(Return(mock_event_router.get())); // Use the magic of googlemock to save a parameter to our mock's - // DispatchEventImpl method into event_args. + // DispatchEventToExtension method into event_args. std::string event_args; std::string expected_event_name = "contextMenus"; EXPECT_CALL(*mock_event_router.get(), @@ -446,6 +447,7 @@ TEST_F(ExtensionMenuManagerTest, ExecuteCommand) { expected_event_name, _, &profile, + "", GURL())) .Times(1) .WillOnce(SaveArg<2>(&event_args)); -- cgit v1.1