Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| index c747a7a757324c489e17ca875e76a4684fed4138..12e2e3b5158be4287dad2dbcdbe675b124fe4413 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -3500,18 +3500,12 @@ void WebViewImpl::PerformCustomContextMenuAction(unsigned action) { |
| } |
| void WebViewImpl::ShowContextMenu(WebMenuSourceType source_type) { |
| - if (!GetPage()) |
| + if (!MainFrameImpl()) |
| return; |
| - GetPage()->GetContextMenuController().ClearContextMenu(); |
| - { |
| - ContextMenuAllowedScope scope; |
| - if (LocalFrame* focused_frame = ToLocalFrame( |
| - GetPage()->GetFocusController().FocusedOrMainFrame())) { |
| - focused_frame->GetEventHandler().ShowNonLocatedContextMenu(nullptr, |
| - source_type); |
| - } |
| - } |
| + // If MainFrameImpl() is non-null, then FrameWidget() will also be non-null. |
| + DCHECK(MainFrameImpl()->FrameWidget()); |
| + MainFrameImpl()->FrameWidget()->ShowContextMenu(source_type); |
|
dcheng
2017/05/26 18:22:27
This frame widget is actually a WebViewFrameWidget
|
| } |
| void WebViewImpl::DidCloseContextMenu() { |