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

Unified Diff: third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp

Issue 2894043002: Add machinery to show touch editing context menus in OOPIFs. (Closed)
Patch Set: Remove WVI call to WFWI. 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/core/frame/WebFrameWidgetBase.cpp
diff --git a/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp b/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp
index 9ee7908429997bd101b086f9ee7adf0e858f6d18..bbd5e23e2590e8175e55d24bc8f2b2306ea0ca8b 100644
--- a/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp
+++ b/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp
@@ -7,14 +7,17 @@
#include "core/dom/DocumentUserGestureToken.h"
#include "core/events/WebInputEventConversion.h"
#include "core/exported/WebViewBase.h"
+#include "core/frame/ContextMenuAllowedScope.h"
#include "core/frame/FrameView.h"
#include "core/frame/VisualViewport.h"
#include "core/frame/WebLocalFrameBase.h"
#include "core/input/EventHandler.h"
+#include "core/page/ContextMenuController.h"
#include "core/page/DragActions.h"
#include "core/page/DragController.h"
#include "core/page/DragData.h"
#include "core/page/DragSession.h"
+#include "core/page/FocusController.h"
#include "core/page/Page.h"
#include "core/page/PointerLockController.h"
#include "platform/UserGestureIndicator.h"
@@ -284,4 +287,17 @@ void WebFrameWidgetBase::PointerLockMouseEvent(const WebInputEvent& event) {
}
}
+void WebFrameWidgetBase::ShowContextMenu() {
+ if (!GetPage())
+ return;
+
+ GetPage()->GetContextMenuController().ClearContextMenu();
+ {
+ ContextMenuAllowedScope scope;
+ if (LocalFrame* focused_frame =
+ ToLocalFrame(GetPage()->GetFocusController().FocusedOrMainFrame()))
+ focused_frame->GetEventHandler().SendContextMenuEventForKey(nullptr);
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698