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

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

Issue 699333003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move the core logic into Java side Created 5 years, 11 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: content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoWrapper.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoWrapper.java b/content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoWrapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..2262999ca6138599afe8d470a3348bb34904ecac
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/input/CursorAnchorInfoWrapper.java
@@ -0,0 +1,64 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser.input;
+
+import android.graphics.Matrix;
+import android.graphics.RectF;
+
+/**
+ * Wrapper around Android's {@link android.view.inputmethod.CursorAnchorInfo}.
+ */
+public interface CursorAnchorInfoWrapper {
+ public static final int FLAG_HAS_VISIBLE_REGION = 0x01;
+ public static final int FLAG_HAS_INVISIBLE_REGION = 0x02;
+ public static final int FLAG_IS_RTL = 0x04;
+
+ /**
+ * Wrapper around Android's {@link android.view.inputmethod.CursorAnchorInfo.Builder}.
+ */
+ interface Builder {
+ Builder setSelectionRange(int newStart, int newEnd);
+
+ Builder setComposingText(int composingTextStart, CharSequence composingText);
+
+ Builder setInsertionMarkerLocation(float horizontalPosition, float lineTop,
+ float lineBaseline, float lineBottom, int flags);
+
+ Builder addCharacterBounds(int index, float left, float top, float right, float bottom,
+ int flags);
+
+ Builder setMatrix(Matrix matrix);
+
+ CursorAnchorInfoWrapper build();
+
+ void reset();
+ }
+
+ int getSelectionStart();
+
+ int getSelectionEnd();
+
+ int getComposingTextStart();
+
+ CharSequence getComposingText();
+
+ int getInsertionMarkerFlags();
+
+ float getInsertionMarkerHorizontal();
+
+ float getInsertionMarkerTop();
+
+ float getInsertionMarkerBaseline();
+
+ float getInsertionMarkerBottom();
+
+ RectF getCharacterBounds(final int index);
+
+ int getCharacterBoundsFlags(final int index);
+
+ Matrix getMatrix();
+
+ Object getObject();
jdduke (slow) 2015/02/09 17:01:17 This is an Object for testing purposes? If so, let
yukawa 2015/02/10 17:24:54 Sorry for the confusion. |CursorAnchorInfoWrapper
+}

Powered by Google App Engine
This is Rietveld 408576698