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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2894043002: Add machinery to show touch editing context menus in OOPIFs. (Closed)
Patch Set: Add DCHECK, rebase test. 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
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);
}
void WebViewImpl::DidCloseContextMenu() {

Powered by Google App Engine
This is Rietveld 408576698