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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 467303002: [Android] Perform haptic feedback after long press when appropriate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hard event reset and refactor Created 6 years, 4 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/input/touch_selection_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 5ea4572ddeff44bd54b55882b2cded4f8f8627ea..6ce15e406ce6e066fa16fb84fe0947ad24a74d72 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -2417,12 +2417,21 @@ public class ContentViewCore
@SuppressWarnings("unused")
@CalledByNative
- private void showPastePopup(int xDip, int yDip) {
- if (!mHasInsertion || !canPaste()) return;
+ private void showPastePopupWithFeedback(int xDip, int yDip) {
+ // TODO(jdduke): Remove this when there is a better signal that long press caused
+ // showing of the paste popup. See http://crbug.com/150151.
+ if (showPastePopup(xDip, yDip)) {
+ mContainerView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+ }
+ }
+
+ private boolean showPastePopup(int xDip, int yDip) {
+ if (!mHasInsertion || !canPaste()) return false;
final float contentOffsetYPix = mRenderCoordinates.getContentOffsetYPix();
getPastePopup().showAt(
(int) mRenderCoordinates.fromDipToPix(xDip),
(int) (mRenderCoordinates.fromDipToPix(yDip) + contentOffsetYPix));
+ return true;
}
private PastePopupMenu getPastePopup() {
« no previous file with comments | « content/browser/renderer_host/input/touch_selection_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698