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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.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
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index a51d75e23852f0e0bc5e1c9b15e8994052f8157e..7767a947664c1689f012a2e425fa02cccbd22b49 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2723,7 +2723,7 @@ bool RenderWidgetHostViewAura::OnShowContextMenu(
#if defined(OS_WIN)
last_context_menu_params_.reset();
- if (params.source_type == ui::MENU_SOURCE_TOUCH) {
+ if (params.source_type == ui::MENU_SOURCE_LONG_PRESS) {
last_context_menu_params_.reset(new ContextMenuParams);
*last_context_menu_params_ = params;
return false;
@@ -2953,12 +2953,12 @@ void RenderWidgetHostViewAura::HandleGestureForTouchSelection(
// On Windows we want to display the context menu when the long press
// gesture is released. To achieve that, we switch the saved context
- // menu params source type to MENU_SOURCE_MOUSE. This is to ensure that
+ // menu params source type to MENU_SOURCE_TOUCH. This is to ensure that
// the RenderWidgetHostViewAura::OnShowContextMenu function which is
// called from the ShowContextMenu call below, does not treat it as
- // a context menu request coming in from touch.
- DCHECK(context_menu_params->source_type == ui::MENU_SOURCE_TOUCH);
- context_menu_params->source_type = ui::MENU_SOURCE_MOUSE;
+ // a context menu request coming in from the long press gesture.
+ DCHECK(context_menu_params->source_type == ui::MENU_SOURCE_LONG_PRESS);
+ context_menu_params->source_type = ui::MENU_SOURCE_TOUCH;
RenderViewHostDelegateView* delegate_view =
GetRenderViewHostDelegateView();

Powered by Google App Engine
This is Rietveld 408576698