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

Unified Diff: content/renderer/input/render_widget_input_handler.cc

Issue 1637743002: Identify context menus being opened via the long press gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add the MENU_SOURCE_LONG_TAP context menu source type and ensure that it gets sent from blink in th… Created 4 years, 11 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | ui/base/ui_base_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/input/render_widget_input_handler.cc
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc
index d5d5255c02f9c864a383a94ca1745f640d47461b..54f2b9c57928582fec78d52d91b673f1674c37a0 100644
--- a/content/renderer/input/render_widget_input_handler.cc
+++ b/content/renderer/input/render_widget_input_handler.cc
@@ -294,7 +294,13 @@ void RenderWidgetInputHandler::HandleInputEvent(
if (WebInputEvent::isGestureEventType(input_event.type)) {
const WebGestureEvent& gesture_event =
static_cast<const WebGestureEvent&>(input_event);
- context_menu_source_type_ = ui::MENU_SOURCE_TOUCH;
+ if (input_event.type == WebInputEvent::GestureLongPress) {
+ context_menu_source_type_ = ui::MENU_SOURCE_LONG_PRESS;
+ } else if (input_event.type == WebInputEvent::GestureLongTap) {
+ context_menu_source_type_ = ui::MENU_SOURCE_LONG_TAP;
+ } else {
+ context_menu_source_type_ = ui::MENU_SOURCE_TOUCH;
tdresser 2016/01/26 20:26:30 Do we ever use ui::MENU_SOURCE_TOUCH now? I though
+ }
prevent_default =
prevent_default || delegate_->WillHandleGestureEvent(gesture_event);
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | ui/base/ui_base_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698