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

Unified Diff: content/renderer/render_view_impl.cc

Issue 197533008: Mac: ExternalPopupMenu::close should hide a showing popup menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 6 years, 9 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/renderer/render_view_impl.h ('k') | content/test/test_web_contents_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 0847fa981ac7c95e682792f231eb2f3f65d83d11..bd5d8c9e7850e8fc8b55221d1f89378e6605a19a 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -4909,14 +4909,8 @@ WebMediaPlayer* RenderViewImpl::CreateAndroidWebMediaPlayer(
#if defined(OS_MACOSX)
void RenderViewImpl::OnSelectPopupMenuItem(int selected_index) {
- if (external_popup_menu_ == NULL) {
- // Crash reports from the field indicate that we can be notified with a
- // NULL external popup menu (we probably get notified twice).
- // If you hit this please file a bug against jcivelli and include the page
- // and steps to repro.
- NOTREACHED();
+ if (external_popup_menu_ == NULL)
return;
- }
external_popup_menu_->DidSelectItem(selected_index);
external_popup_menu_.reset();
}
@@ -4938,6 +4932,12 @@ void RenderViewImpl::OnSelectPopupMenuItems(
}
#endif
+void RenderViewImpl::DidHideExternalPopupMenu() {
+ // We need to clear external_popup_menu_ as soon as ExternalPopupMenu::close
+ // is called. Otherwise, createExternalPopupMenu() for new popup will fail.
+ external_popup_menu_.reset();
+}
+
void RenderViewImpl::OnShowContextMenu(const gfx::Point& location) {
context_menu_source_type_ = ui::MENU_SOURCE_TOUCH_EDIT_MENU;
touch_editing_context_menu_location_ = location;
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/test/test_web_contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698