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

Unified Diff: chrome/renderer/blocked_plugin.cc

Issue 7768001: Add support for exporting IPC messages from component DLLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/render_messages.h ('k') | content/browser/renderer_host/p2p/socket_host_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/blocked_plugin.cc
===================================================================
--- chrome/renderer/blocked_plugin.cc (revision 98434)
+++ chrome/renderer/blocked_plugin.cc (working copy)
@@ -51,7 +51,7 @@
static const unsigned kMenuActionLoad = 1;
static const unsigned kMenuActionRemove = 2;
-static const BlockedPlugin* gLastActiveMenu;
+static const BlockedPlugin* g_last_active_menu;
BlockedPlugin::BlockedPlugin(RenderView* render_view,
WebFrame* frame,
@@ -139,7 +139,7 @@
menu_data.customItems.swap(custom_items);
menu_data.mousePosition = WebPoint(event.windowX, event.windowY);
render_view()->showContextMenu(NULL, menu_data);
- gLastActiveMenu = this;
+ g_last_active_menu = this;
}
bool BlockedPlugin::OnMessageReceived(const IPC::Message& message) {
@@ -147,17 +147,11 @@
// 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 &&
- gLastActiveMenu == this) {
- ViewMsg_CustomContextMenuAction::Dispatch(
- &message, this, this, &BlockedPlugin::OnMenuItemSelected);
- } else {
- IPC_BEGIN_MESSAGE_MAP(BlockedPlugin, message)
- IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins,
- OnLoadBlockedPlugins)
- IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering)
- IPC_END_MESSAGE_MAP()
- }
+ IPC_BEGIN_MESSAGE_MAP(BlockedPlugin, message)
+ IPC_MESSAGE_HANDLER(ViewMsg_CustomContextMenuAction, OnMenuItemSelected)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering)
+ IPC_END_MESSAGE_MAP()
return false;
}
@@ -165,6 +159,8 @@
void BlockedPlugin::OnMenuItemSelected(
const webkit_glue::CustomContextMenuContext& /* ignored */,
unsigned id) {
+ if (g_last_active_menu != this)
+ return;
if (id == kMenuActionLoad) {
Send(new ViewHostMsg_UserMetricsRecordAction("Plugin_Load_Menu"));
LoadPlugin();
« no previous file with comments | « chrome/common/render_messages.h ('k') | content/browser/renderer_host/p2p/socket_host_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698