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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTapState.java

Issue 2096203002: [TTS] Basic Tap Suppression functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added compensation for Quick Answers and rebased. Created 4 years, 6 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/contextualsearch/ContextualSearchTapState.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTapState.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTapState.java
index ce2495ef0b27a055685aed53b3f14c5b51c781dc..518121222e37210776ab13ecb1ed3b8d702d326f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTapState.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTapState.java
@@ -6,36 +6,50 @@ package org.chromium.chrome.browser.contextualsearch;
/**
* Encapsulates the state of a recent Tap gesture; x, y position and if suppressed.
+ * Instances of this class are immutable.
*/
class ContextualSearchTapState {
- private final boolean mWasSuppressed;
private final float mX;
private final float mY;
+ private final long mTapTimeNanoseconds;
+ private final boolean mWasSuppressed;
/**
* Constructs a Tap at the given x,y position and indicates if the tap was suppressed or not.
+ * @param x The x coordinate of the current tap.
+ * @param y The y coordinate of the current tap.
+ * @param tapTimeNanoseconds The timestamp when the Tap occurred.
+ * @param wasSuppressed Whether this tap was suppressed for any reason.
*/
- ContextualSearchTapState(float x, float y, boolean wasSuppressed) {
- mWasSuppressed = wasSuppressed;
+ ContextualSearchTapState(float x, float y, long tapTimeNanoseconds, boolean wasSuppressed) {
mX = x;
mY = y;
+ mTapTimeNanoseconds = tapTimeNanoseconds;
+ mWasSuppressed = wasSuppressed;
}
/**
* @return The x coordinate of the Tap.
*/
- float x() {
+ float getX() {
return mX;
}
/**
* @return The y coordinate of the Tap.
*/
- float y() {
+ float getY() {
return mY;
}
/**
+ * @return The time of the Tap in nanoseconds.
+ */
+ long tapTimeNanoseconds() {
+ return mTapTimeNanoseconds;
+ }
+
+ /**
* @return Whether this Tap was suppressed.
*/
boolean wasSuppressed() {

Powered by Google App Engine
This is Rietveld 408576698