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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 10941015: [Android] Upstream the WebView find-in-page API implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit fixes. Created 8 years, 3 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: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 3f826a97f614b2b1a921164564ff77bb8a4d300a..c0a1a6f74e4710b3faf59ed294c8d8ac82071fc3 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -102,8 +102,24 @@ public class AwContents {
mCleanupReference.cleanupNow();
}
+ public int findAllSync(String searchString) {
+ return nativeFindAllSync(mNativeAwContents, searchString);
+ }
+
+ public void findAllAsync(String searchString) {
+ nativeFindAllAsync(mNativeAwContents, searchString);
+ }
+
+ public void findNext(boolean forward) {
+ nativeFindNext(mNativeAwContents, forward);
+ }
+
+ public void clearMatches() {
+ nativeClearMatches(mNativeAwContents);
+ }
+
/**
- * @return load progress of the WebContents
+ * @return load progress of the WebContents.
*/
public int getMostRecentProgress() {
// WebContentsDelegateAndroid conveniently caches the most recent notified value for us.
@@ -182,6 +198,12 @@ public class AwContents {
mContentsClient.onReceivedHttpAuthRequest(handler, host, realm);
}
+ @CalledByNative
+ public void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches,
+ boolean isDoneCounting) {
+ mContentsClient.onFindResultReceived(activeMatchOrdinal, numberOfMatches, isDoneCounting);
+ }
+
// -------------------------------------------------------------------------------------------
// Helper methods
// -------------------------------------------------------------------------------------------
@@ -270,4 +292,9 @@ public class AwContents {
private native void nativeSetIoThreadClient(int nativeAwContents,
AwContentsIoThreadClient ioThreadClient);
+
+ private native int nativeFindAllSync(int nativeAwContents, String searchString);
+ private native void nativeFindAllAsync(int nativeAwContents, String searchString);
+ private native void nativeFindNext(int nativeAwContents, boolean forward);
+ private native void nativeClearMatches(int nativeAwContents);
}

Powered by Google App Engine
This is Rietveld 408576698