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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java

Issue 1986783002: Text selected with double-tap should not cause vibration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added description of return value of showContextMenu Created 4 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: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
index ac5f96deea5ad4c38f75ea47857dbe79eed3f083..172c09d7c393febb93d09a43b26aaaa567ba6aa6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.contextmenu;
import android.app.Activity;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
-import android.view.HapticFeedbackConstants;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
@@ -62,8 +61,7 @@ public class ContextMenuHelper implements OnCreateContextMenuListener, OnMenuIte
private boolean showContextMenu(ContentViewCore contentViewCore, ContextMenuParams params) {
final View view = contentViewCore.getContainerView();
- if (!shouldShowMenu(params)
- || view == null
+ if (view == null
|| view.getVisibility() != View.VISIBLE
|| view.getParent() == null) {
return false;
@@ -71,7 +69,6 @@ public class ContextMenuHelper implements OnCreateContextMenuListener, OnMenuIte
mCurrentContextMenuParams = params;
- view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
view.setOnCreateContextMenuListener(this);
if (view.showContextMenu()) {
WebContents webContents = contentViewCore.getWebContents();
@@ -120,8 +117,6 @@ public class ContextMenuHelper implements OnCreateContextMenuListener, OnMenuIte
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
- if (!shouldShowMenu(mCurrentContextMenuParams)) return;
-
assert mPopulator != null;
mPopulator.buildContextMenu(menu, v.getContext(), mCurrentContextMenuParams);
@@ -143,10 +138,6 @@ public class ContextMenuHelper implements OnCreateContextMenuListener, OnMenuIte
return mPopulator;
}
- private boolean shouldShowMenu(ContextMenuParams params) {
- return (mPopulator != null && mPopulator.shouldShowContextMenu(params));
- }
-
private native void nativeOnStartDownload(
long nativeContextMenuHelper, boolean isLink, boolean isDataReductionProxyEnabled);
private native void nativeSearchForImage(long nativeContextMenuHelper);

Powered by Google App Engine
This is Rietveld 408576698