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

Unified Diff: chrome/browser/tab_contents/tab_contents_view_mac.mm

Issue 4078003: Refactoring select popup on Mac.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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: chrome/browser/tab_contents/tab_contents_view_mac.mm
===================================================================
--- chrome/browser/tab_contents/tab_contents_view_mac.mm (revision 63740)
+++ chrome/browser/tab_contents/tab_contents_view_mac.mm (working copy)
@@ -20,6 +20,7 @@
#include "chrome/browser/renderer_host/render_view_host_factory.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
+#include "chrome/browser/tab_contents/popup_menu_helper_mac.h"
#include "chrome/browser/tab_contents/render_view_context_menu_mac.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
@@ -252,6 +253,19 @@
menu.Init();
}
+// Display a popup menu for WebKit using Cocoa widgets.
+void TabContentsViewMac::ShowPopupMenu(
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<WebMenuItem>& items,
+ bool right_aligned) {
+ PopupMenuHelper popup_menu_helper(tab_contents()->render_view_host());
+ popup_menu_helper.ShowPopupMenu(bounds, item_height, item_font_size,
+ selected_item, items, right_aligned);
+}
+
RenderWidgetHostView* TabContentsViewMac::CreateNewWidgetInternal(
int route_id,
WebKit::WebPopupType popup_type) {
@@ -263,9 +277,6 @@
static_cast<RenderWidgetHostViewMac*>(widget_view);
[widget_view_mac->native_view() retain];
- // |widget_view_mac| needs to know how to position itself in our view.
- widget_view_mac->set_parent_view(cocoa_view_);
-
return widget_view;
}
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_view_mac.h ('k') | chrome/browser/views/tab_contents/tab_contents_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698