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

Unified Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 2888803002: Handle WebContentsViewMac being destroyed while a <select> menu is showing. (Closed)
Patch Set: respond to comments Created 3 years, 7 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/browser/web_contents/web_contents_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_mac.mm
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index 2b457494ab70022635a2033e92c34dad367d2f67..ebd0ce35c1c1aeae9462cafc348722bb01224b5e 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -307,11 +307,11 @@ void WebContentsViewMac::ShowPopupMenu(
const std::vector<MenuItem>& items,
bool right_aligned,
bool allow_multiple_selection) {
- popup_menu_helper_.reset(new PopupMenuHelper(render_frame_host));
+ popup_menu_helper_.reset(new PopupMenuHelper(this, render_frame_host));
popup_menu_helper_->ShowPopupMenu(bounds, item_height, item_font_size,
selected_item, items, right_aligned,
allow_multiple_selection);
- popup_menu_helper_.reset();
+ // Note: |this| may be deleted here.
}
void WebContentsViewMac::HidePopupMenu() {
@@ -319,6 +319,10 @@ void WebContentsViewMac::HidePopupMenu() {
popup_menu_helper_->Hide();
}
+void WebContentsViewMac::OnMenuClosed() {
+ popup_menu_helper_.reset();
+}
+
gfx::Rect WebContentsViewMac::GetViewBounds() const {
// This method is not currently used on mac.
NOTIMPLEMENTED();
« no previous file with comments | « content/browser/web_contents/web_contents_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698