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

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

Issue 10890024: Implement DocuementHasImages (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix test Created 8 years, 4 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 a5003ad253a878d9a7f6cc66a89363f1f0aadb39..7addd038ec8be4eae77feebebef2ad75f8206788 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -5,7 +5,9 @@
package org.chromium.android_webview;
import android.view.ViewGroup;
+import android.os.Message;
+import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.common.CleanupReference;
@@ -78,12 +80,6 @@ public class AwContents {
mCleanupReference.cleanupNow();
}
- private native int nativeInit(AwWebContentsDelegate webViewWebContentsDelegate,
- boolean privateBrowsing);
- private static native void nativeDestroy(int nativeAwContents);
-
- private native int nativeGetWebContents(int nativeAwContents);
-
/**
* @return load progress of the WebContents
*/
@@ -91,4 +87,34 @@ public class AwContents {
// WebContentsDelegateAndroid conveniently caches the most recent notified value for us.
return mContentsClient.getWebContentsDelegate().getMostRecentProgress();
}
+
+ //--------------------------------------------------------------------------------------------
+ // WebView[Provider] method implementations (where not provided by ContentViewCore)
+ //--------------------------------------------------------------------------------------------
+
+ public void documentHasImages(Message message) {
+ nativeDocumentHasImages(mNativeAwContents, message);
+ }
+
+ //--------------------------------------------------------------------------------------------
+ // Methods called from native via JNI
+ //--------------------------------------------------------------------------------------------
+
+ @CalledByNative
+ private static void onDocumentHasImagesResponse(boolean result, Message message) {
+ message.arg1 = result ? 1 : 0;
+ message.sendToTarget();
+ }
+
+ //--------------------------------------------------------------------------------------------
+ // Native methods
+ //--------------------------------------------------------------------------------------------
+
+ private native int nativeInit(AwWebContentsDelegate webViewWebContentsDelegate,
+ boolean privateBrowsing);
+ private static native void nativeDestroy(int nativeAwContents);
+
+ private native int nativeGetWebContents(int nativeAwContents);
+
+ private native void nativeDocumentHasImages(int nativeAwContents, Message message);
}

Powered by Google App Engine
This is Rietveld 408576698