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

Unified Diff: chrome/renderer/plugins/plugin_placeholder.h

Issue 11083002: Allow custom context menus to be requested. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « no previous file | chrome/renderer/plugins/plugin_placeholder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/plugins/plugin_placeholder.h
diff --git a/chrome/renderer/plugins/plugin_placeholder.h b/chrome/renderer/plugins/plugin_placeholder.h
index 5ea346a7061f5184916582cbf45ed3b0caf90048..75bb1bd36eb47233ec641cedca1f4e4d3481dd0c 100644
--- a/chrome/renderer/plugins/plugin_placeholder.h
+++ b/chrome/renderer/plugins/plugin_placeholder.h
@@ -5,6 +5,7 @@
#ifndef CHROME_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_H_
#define CHROME_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_H_
+#include "content/public/renderer/context_menu_client.h"
#include "content/public/renderer/render_process_observer.h"
#include "content/public/renderer/render_view_observer.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
@@ -23,7 +24,8 @@ struct WebPluginInfo;
class PluginPlaceholder : public content::RenderViewObserver,
public content::RenderProcessObserver,
public webkit_glue::CppBoundClass,
- public webkit::WebViewPlugin::Delegate {
+ public webkit::WebViewPlugin::Delegate,
+ public content::ContextMenuClient {
public:
// Creates a new WebViewPlugin with a MissingPlugin as a delegate.
static PluginPlaceholder* CreateMissingPlugin(
@@ -93,12 +95,15 @@ class PluginPlaceholder : public content::RenderViewObserver,
virtual void ShowContextMenu(const WebKit::WebMouseEvent&) OVERRIDE;
// content::RenderViewObserver methods:
- virtual void ContextMenuAction(unsigned id) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// content::RenderProcessObserver methods:
virtual void PluginListChanged() OVERRIDE;
+ // content::ContextMenuClient methods:
+ virtual void OnMenuAction(int request_id, unsigned action) OVERRIDE;
+ virtual void OnMenuClosed(int request_id) OVERRIDE;
+
// Replace this placeholder with a different plugin (which could be
// a placeholder again).
void ReplacePlugin(WebKit::WebPlugin* new_plugin);
@@ -180,6 +185,7 @@ class PluginPlaceholder : public content::RenderViewObserver,
bool finished_loading_;
string16 plugin_name_;
std::string identifier_;
+ int context_menu_request_id_; // Nonzero when request pending.
DISALLOW_COPY_AND_ASSIGN(PluginPlaceholder);
};
« no previous file with comments | « no previous file | chrome/renderer/plugins/plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698