Index: content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java b/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java |
index 9dfccc8cae26f71f75985956a85595684723b1ba..f4ad96f27339b7b7dbc915d8b9e2ec7845e807c3 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java |
@@ -21,6 +21,11 @@ import org.chromium.base.annotations.JNINamespace; |
*/ |
@JNINamespace("content") |
public class HandleViewResources { |
+ // Android handle drawables have a transparent horizontal padding, |
+ // which is one-fourth of the image. This variable is to take the |
+ // padding ratio into account while calculating the handle origin position. |
+ private static final float HANDLE_HORIZONTAL_PADDING_RATIO = 0.25f; |
+ |
private static final int[] LEFT_HANDLE_ATTRS = { |
android.R.attr.textSelectHandleLeft, |
}; |
@@ -96,6 +101,11 @@ public class HandleViewResources { |
} |
@CalledByNative |
+ public static float getHandleHorizontalPaddingRatio() { |
+ return HANDLE_HORIZONTAL_PADDING_RATIO; |
+ } |
+ |
+ @CalledByNative |
private static Bitmap getLeftHandleBitmap(Context context) { |
return getHandleBitmap(context, LEFT_HANDLE_ATTRS); |
} |