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

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

Issue 2882583004: [SmartText selection] Implement TextClassifier getter and setter (Closed)
Patch Set: Rebased again Created 3 years, 7 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/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 40182a1e09a563022f220e2973991205bd835bb7..c583d9926ff7e014cb0b6ded0b59473bded89ece 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -2349,6 +2349,32 @@ public class ContentViewCore
mSelectionPopupController.setSelectionClient(selectionClient);
}
+ // TODO(timav): Use |TextClassifier| instead of |Object| after we switch to Android SDK 26.
+ /**
+ * Sets TextClassifier for Smart Text selection.
+ */
+ public void setTextClassifier(Object textClassifier) {
+ mSelectionPopupController.setTextClassifier(textClassifier);
+ }
+
+ // TODO(timav): Use |TextClassifier| instead of |Object| after we switch to Android SDK 26.
+ /**
+ * Returns TextClassifier that is used for Smart Text selection. If the custom classifier
+ * has been set with setTextClassifier, returns that object, otherwise returns the system
+ * classifier.
+ */
+ public Object getTextClassifier() {
+ return mSelectionPopupController.getTextClassifier();
+ }
+
+ // TODO(timav): Use |TextClassifier| instead of |Object| after we switch to Android SDK 26.
+ /**
+ * Returns the TextClassifier which has been set with setTextClassifier(), or null.
+ */
+ public Object getCustomTextClassifier() {
+ return mSelectionPopupController.getCustomTextClassifier();
+ }
+
private native long nativeInit(WebContents webContents, ViewAndroidDelegate viewAndroidDelegate,
long windowAndroidPtr, float dipScale, HashSet<Object> retainedObjectSet);
private static native ContentViewCore nativeFromWebContentsAndroid(WebContents webContents);

Powered by Google App Engine
This is Rietveld 408576698