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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.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
Index: content/renderer/pepper/pepper_plugin_delegate_impl.h
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.h b/content/renderer/pepper/pepper_plugin_delegate_impl.h
index c21ef21dace4e49c807d65cf9495f3afe0603d0c..653de6b4d5d5ef9461a06959fb5de89efa794565 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.h
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.h
@@ -17,6 +17,7 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "content/common/content_export.h"
+#include "content/public/renderer/context_menu_client.h"
#include "content/public/renderer/render_view_observer.h"
#include "content/renderer/mouse_lock_dispatcher.h"
#include "content/renderer/pepper/pepper_parent_context_provider.h"
@@ -66,7 +67,6 @@ struct WebCompositionUnderline;
namespace content {
-struct CustomContextMenuContext;
class GamepadSharedMemoryReader;
class PepperBrokerImpl;
class PepperDeviceEnumerationEventHandler;
@@ -76,7 +76,8 @@ class PepperPluginDelegateImpl
: public webkit::ppapi::PluginDelegate,
public base::SupportsWeakPtr<PepperPluginDelegateImpl>,
public PepperParentContextProvider,
- public RenderViewObserver {
+ public RenderViewObserver,
+ public ContextMenuClient {
public:
explicit PepperPluginDelegateImpl(RenderViewImpl* render_view);
virtual ~PepperPluginDelegateImpl();
@@ -353,14 +354,6 @@ class PepperPluginDelegateImpl
webkit::ppapi::PluginInstance* instance,
webkit::ppapi::PPB_Flash_Menu_Impl* menu,
const gfx::Point& position) OVERRIDE;
- void OnContextMenuClosed(
- const CustomContextMenuContext& custom_context);
- void OnCustomContextMenuAction(
- const CustomContextMenuContext& custom_context,
- unsigned action);
- void CompleteShowContextMenu(int request_id,
- bool did_select,
- unsigned action);
virtual webkit::ppapi::FullscreenContainer*
CreateFullscreenContainer(
webkit::ppapi::PluginInstance* instance) OVERRIDE;
@@ -471,6 +464,10 @@ class PepperPluginDelegateImpl
scoped_refptr<PepperBrokerImpl> CreateBroker(
webkit::ppapi::PluginModule* plugin_module);
+ // ContextMenuClient implementation.
+ virtual void OnMenuAction(int request_id, unsigned action) OVERRIDE;
+ virtual void OnMenuClosed(int request_id) OVERRIDE;
+
// Implementation of PepperParentContextProvider.
virtual WebGraphicsContext3DCommandBufferImpl*
GetParentContextForPlatformContext3D() OVERRIDE;
@@ -504,8 +501,10 @@ class PepperPluginDelegateImpl
IDMap<ppapi::PPB_HostResolver_Shared> host_resolvers_;
- IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>,
- IDMapOwnPointer> pending_context_menus_;
+ // Maps context menu request IDs to the menu resource to receive the result.
+ typedef std::map<int, scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl> >
+ PendingContextMenuMap;
+ PendingContextMenuMap pending_context_menus_;
typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap;
BrokerMap pending_connect_broker_;
« no previous file with comments | « content/public/renderer/render_view_observer.h ('k') | content/renderer/pepper/pepper_plugin_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698