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() { |