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

Unified Diff: content/public/browser/web_contents_view_delegate.h

Issue 2026813003: Enable external popup menu in Blimp, part 2/2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « content/public/browser/render_frame_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/web_contents_view_delegate.h
diff --git a/content/public/browser/web_contents_view_delegate.h b/content/public/browser/web_contents_view_delegate.h
index 7be6c6f6fc83ad2d43ee3b316692cecc0646e19f..cbc226781537a43c6c86cb5ab9203ea4504ebd94 100644
--- a/content/public/browser/web_contents_view_delegate.h
+++ b/content/public/browser/web_contents_view_delegate.h
@@ -9,6 +9,8 @@
#import <Cocoa/Cocoa.h>
#endif
+#include <vector>
+
#include "base/callback_forward.h"
#include "content/common/content_export.h"
#include "ui/gfx/native_widget_types.h"
@@ -32,6 +34,7 @@ class RenderFrameHost;
class RenderWidgetHost;
class WebDragDestDelegate;
struct ContextMenuParams;
+struct MenuItem;
// This interface allows a client to extend the functionality of the
// WebContentsView implementation.
@@ -59,8 +62,25 @@ class CONTENT_EXPORT WebContentsViewDelegate {
virtual void TakeFocus(bool reverse);
virtual void SizeChanged(const gfx::Size& size);
- // Returns a newly-created delegate for the RenderWidgetHostViewMac, to handle
- // events on the responder chain.
+#if defined(USE_EXTERNAL_POPUP_MENU) && defined(USE_AURA)
+ // Shows a popup menu with the specified items.
+ // This method should call RenderFrameHost::DidSelectPopupMenuItem[s]() or
+ // RenderFrameHost::DidCancelPopupMenu() based on the user action.
+ virtual void ShowPopupMenu(RenderFrameHost* render_frame_host,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<MenuItem>& items,
+ bool right_aligned,
+ bool allow_multiple_selection) {}
+
+ // Hides a popup menu opened by ShowPopupMenu().
+ virtual void HidePopupMenu() {}
+#endif
+
+// Returns a newly-created delegate for the RenderWidgetHostViewMac, to handle
+// events on the responder chain.
#if defined(__OBJC__)
virtual NSObject<RenderWidgetHostViewMacDelegate>*
CreateRenderWidgetHostViewDelegate(
« no previous file with comments | « content/public/browser/render_frame_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698