summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-22 01:37:46 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-22 01:37:46 +0000
commit7cd1d802b4c6c929ffdce3892e745ec04030558b (patch)
tree8dda93bb9f82b1306ebf6b7de419c70c591ee40b
parent7d47247a01a05d53b4a28a397aefc72efa250bc2 (diff)
downloadchromium_src-7cd1d802b4c6c929ffdce3892e745ec04030558b.zip
chromium_src-7cd1d802b4c6c929ffdce3892e745ec04030558b.tar.gz
chromium_src-7cd1d802b4c6c929ffdce3892e745ec04030558b.tar.bz2
Oops, fix my previous fix to the refactor breakage. Make sure we only apply
the current menu command to whoever opened the custom menu. We have to track it in a slightly ugly manner thanks to GTK's out-of-order messaging for "menu item selected" vs. "context menu closed". BUG=NONE TEST=manual Review URL: http://codereview.chromium.org/6278013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72251 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/blocked_plugin.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc
index d73192f..229f08f 100644
--- a/chrome/renderer/blocked_plugin.cc
+++ b/chrome/renderer/blocked_plugin.cc
@@ -47,6 +47,8 @@ static const char* const kBlockedPluginDataURL = "chrome://blockedplugindata/";
static const unsigned kMenuActionLoad = 1;
static const unsigned kMenuActionRemove = 2;
+static const BlockedPlugin* gLastActiveMenu;
+
BlockedPlugin::BlockedPlugin(RenderView* render_view,
WebFrame* frame,
const webkit::npapi::PluginGroup& info,
@@ -122,6 +124,7 @@ void BlockedPlugin::ShowContextMenu(const WebKit::WebMouseEvent& event) {
menu_data.customItems.swap(custom_items);
menu_data.mousePosition = WebPoint(event.windowX, event.windowY);
render_view()->showContextMenu(NULL, menu_data);
+ gLastActiveMenu = this;
}
bool BlockedPlugin::OnMessageReceived(const IPC::Message& message) {
@@ -129,7 +132,8 @@ bool BlockedPlugin::OnMessageReceived(const IPC::Message& message) {
// custom menu IDs, and not just our own. We don't swallow
// ViewMsg_LoadBlockedPlugins because multiple blocked plugins have an
// interest in it.
- if (message.type() == ViewMsg_CustomContextMenuAction::ID) {
+ if (message.type() == ViewMsg_CustomContextMenuAction::ID &&
+ gLastActiveMenu == this) {
ViewMsg_CustomContextMenuAction::Dispatch(
&message, this, this, &BlockedPlugin::OnMenuItemSelected);
} else if (message.type() == ViewMsg_LoadBlockedPlugins::ID) {