Commit a4ab41ab authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

fixup! Convert WidgetMsg_ShowContextMenu to Mojo

This CL is to fix the regressions caused by r785154. r785154 has been
causing two regressions. One is the context menu is opened at the wrong place
once right click is used inside emulation window. The other one is
a crash happens when performing a right click on 'Color selector'
overlay in emulation view.

The first regression caused by r785154 missed clearing
|host_context_menu_location_| unlike the original behavior. So, it
made RenderFrameImpl::ShowContextMenu() calculate the position of
the context menu with |host_context_menu_location| instead of the
current window position unlike the original behavior.

And, the second regresion was caused by RenderWidgetHostImpl::ShowContextMenuAtPoint
calls ShowContextMenu() through the Mojo message without checking if
|blink_frame_widget_| is bound.

This CL fixes those regressions.

Bug: 1093960, 1113088, 1115440
Change-Id: I94c3c385caeacda5561d30e6fd7ced6e86d69201
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354128Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#798639}
parent 4cc683c0
......@@ -1897,7 +1897,8 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
const gfx::Point& point,
const ui::MenuSourceType source_type) {
GetAssociatedFrameWidget()->ShowContextMenu(source_type, point);
if (blink_frame_widget_)
blink_frame_widget_->ShowContextMenu(source_type, point);
}
RenderProcessHost::Priority RenderWidgetHostImpl::GetPriority() {
......
......@@ -829,6 +829,7 @@ void WebFrameWidgetBase::ShowContextMenu(
nullptr, static_cast<blink::WebMenuSourceType>(source_type));
}
}
host_context_menu_location_.reset();
}
base::Optional<gfx::Point>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment