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 f0b15e8e899525c8c9cc3dd8d5d5d742bb9b8067..a54391cf3d1849b1a51344b3d905592bfdf76cc8 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,9 +58,6 @@ public class PopupTouchHandleDrawable extends View { |
private final int[] mTempScreenCoords = new int[2]; |
- static final int LEFT = 0; |
- static final int CENTER = 1; |
- static final int RIGHT = 2; |
private int mOrientation = -1; |
// Length of the delay before fading in after the last page movement. |
@@ -144,8 +141,10 @@ public class PopupTouchHandleDrawable extends View { |
return handled; |
} |
+ @CalledByNative |
private void setOrientation(int orientation) { |
- assert orientation >= LEFT && orientation <= RIGHT; |
+ assert orientation >= TouchHandleOrientation.TOUCH_HANDLE_LEFT |
+ && orientation <= TouchHandleOrientation.TOUCH_HANDLE_RIGHT; |
if (mOrientation == orientation) return; |
final boolean hadValidOrientation = mOrientation != -1; |
@@ -155,24 +154,27 @@ public class PopupTouchHandleDrawable extends View { |
final int oldAdjustedPositionY = getAdjustedPositionY(); |
switch (orientation) { |
- case LEFT: { |
+ case TouchHandleOrientation.TOUCH_HANDLE_LEFT: { |
mDrawable = HandleViewResources.getLeftHandleDrawable(mContext); |
mHotspotX = (mDrawable.getIntrinsicWidth() * 3) / 4f; |
break; |
} |
- case RIGHT: { |
+ case TouchHandleOrientation.TOUCH_HANDLE_RIGHT: { |
mDrawable = HandleViewResources.getRightHandleDrawable(mContext); |
mHotspotX = mDrawable.getIntrinsicWidth() / 4f; |
break; |
} |
- case CENTER: |
- default: { |
+ case TouchHandleOrientation.TOUCH_HANDLE_CENTER: { |
mDrawable = HandleViewResources.getCenterHandleDrawable(mContext); |
mHotspotX = mDrawable.getIntrinsicWidth() / 2f; |
break; |
} |
+ |
+ case TouchHandleOrientation.TOUCH_HANDLE_ORIENTATION_UNDEFINED: |
+ default: |
+ break; |
} |
mHotspotY = 0; |
@@ -344,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. |