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

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

Issue 2785853002: Selection Action mode triggered like a context menu (Closed)
Patch Set: fixing tests 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 d36de3c215f4d59dc92c685cebf17884f9da6500..dfcfe256881d0a62d1f1604c5e2e862a864b110a 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -67,6 +67,7 @@
#include "core/html/HTMLMediaElement.h"
#include "core/html/HTMLPlugInElement.h"
#include "core/html/HTMLTextAreaElement.h"
+#include "core/input/ContextMenuAllowedScope.h"
#include "core/input/EventHandler.h"
#include "core/input/TouchActionUtil.h"
#include "core/layout/LayoutPart.h"
@@ -162,7 +163,6 @@
#include "web/AnimationWorkletProxyClientImpl.h"
#include "web/CompositorMutatorImpl.h"
#include "web/CompositorWorkerProxyClientImpl.h"
-#include "web/ContextMenuAllowedScope.h"
#include "web/DedicatedWorkerMessagingProxyProviderImpl.h"
#include "web/DevToolsEmulator.h"
#include "web/FullscreenController.h"
@@ -841,9 +841,13 @@ WebInputEventResult WebViewImpl::HandleGestureEvent(
}
}
- event_result =
- MainFrameImpl()->GetFrame()->GetEventHandler().HandleGestureEvent(
- targeted_event);
+ {
+ ContextMenuAllowedScope scope;
+ event_result =
+ MainFrameImpl()->GetFrame()->GetEventHandler().HandleGestureEvent(
+ targeted_event);
+ }
+
if (page_popup_ && last_hidden_page_popup_ &&
page_popup_->HasSamePopupClient(last_hidden_page_popup_.Get())) {
// The tap triggered a page popup that is the same as the one we just
@@ -1651,7 +1655,7 @@ WebInputEventResult WebViewImpl::SendContextMenuEvent(
focused_element->scrollIntoViewIfNeeded();
return ToLocalFrame(focused_frame)
->GetEventHandler()
- .SendContextMenuEventForKey(nullptr);
+ .ShowNonLocatedContextMenu(nullptr);
}
}
#else
@@ -1683,7 +1687,7 @@ void WebViewImpl::ShowContextMenuForElement(WebElement element) {
ContextMenuAllowedScope scope;
if (LocalFrame* focused_frame =
ToLocalFrame(GetPage()->GetFocusController().FocusedOrMainFrame()))
- focused_frame->GetEventHandler().SendContextMenuEventForKey(
+ focused_frame->GetEventHandler().ShowNonLocatedContextMenu(
element.Unwrap<Element>());
}
}
@@ -3516,8 +3520,8 @@ void WebViewImpl::ShowContextMenu(WebMenuSourceType source_type) {
ContextMenuAllowedScope scope;
if (LocalFrame* focused_frame = ToLocalFrame(
GetPage()->GetFocusController().FocusedOrMainFrame())) {
- focused_frame->GetEventHandler().SendContextMenuEventForKey(nullptr,
- source_type);
+ focused_frame->GetEventHandler().ShowNonLocatedContextMenu(nullptr,
+ source_type);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698