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

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

Issue 701823002: Separate out Touch Selection Orientation enum (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java b/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java
index b9542e98d630dc8b5a46a2abb0fb803ea464b0d8..25a566821215fdd4d3061a2a2f916deb3e55a7fd 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java
@@ -58,11 +58,6 @@ public class PopupTouchHandleDrawable extends View {
private final int[] mTempScreenCoords = new int[2];
- @SuppressLint("RtlHardcoded")
- static final int LEFT = 0;
- static final int CENTER = 1;
- @SuppressLint("RtlHardcoded")
- static final int RIGHT = 2;
private int mOrientation = -1;
jdduke (slow) 2014/11/11 21:04:30 Let's initialize this to TouchHandleOrientation.O
AviD 2015/02/25 05:49:05 Done.
// Length of the delay before fading in after the last page movement.
@@ -146,8 +141,10 @@ public class PopupTouchHandleDrawable extends View {
return handled;
}
+ @CalledByNative
private void setOrientation(int orientation) {
- assert orientation >= LEFT && orientation <= RIGHT;
+ assert orientation >= TouchHandleOrientation.LEFT
+ && orientation <= TouchHandleOrientation.RIGHT;
if (mOrientation == orientation) return;
final boolean hadValidOrientation = mOrientation != -1;
jdduke (slow) 2014/11/11 21:04:30 Also make this reference TouchHandleOrientation.OR
AviD 2015/02/25 05:49:05 Done.
@@ -157,24 +154,27 @@ public class PopupTouchHandleDrawable extends View {
final int oldAdjustedPositionY = getAdjustedPositionY();
switch (orientation) {
- case LEFT: {
+ case TouchHandleOrientation.LEFT: {
mDrawable = HandleViewResources.getLeftHandleDrawable(mContext);
mHotspotX = (mDrawable.getIntrinsicWidth() * 3) / 4f;
break;
}
- case RIGHT: {
+ case TouchHandleOrientation.RIGHT: {
mDrawable = HandleViewResources.getRightHandleDrawable(mContext);
mHotspotX = mDrawable.getIntrinsicWidth() / 4f;
break;
}
- case CENTER:
- default: {
+ case TouchHandleOrientation.CENTER: {
mDrawable = HandleViewResources.getCenterHandleDrawable(mContext);
mHotspotX = mDrawable.getIntrinsicWidth() / 2f;
break;
}
+
+ case TouchHandleOrientation.ORIENTATION_UNDEFINED:
+ default:
+ break;
}
mHotspotY = 0;
@@ -346,21 +346,6 @@ public class PopupTouchHandleDrawable extends View {
}
@CalledByNative
- private void setRightOrientation() {
- setOrientation(RIGHT);
- }
-
- @CalledByNative
- private void setLeftOrientation() {
- setOrientation(LEFT);
- }
-
- @CalledByNative
- private void setCenterOrientation() {
- setOrientation(CENTER);
- }
-
- @CalledByNative
private void setOpacity(float alpha) {
// Ignore opacity updates from the caller as they are not compatible
// with the custom fade animation.

Powered by Google App Engine
This is Rietveld 408576698