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

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

Issue 2014553002: Implement WebContents.downloadImage() on Java side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Ted's comments Created 4 years, 6 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
« no previous file with comments | « content/public/android/java/src/org/chromium/content_public/browser/ImageDownloadCallback.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java b/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
index 01e5ba835d7076b65edb6552dfc168722542a335..e12626202ae6b74bd649c0fa246c868f5a57f142 100644
--- a/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
+++ b/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
@@ -361,4 +361,24 @@ public interface WebContents extends Parcelable {
* Reloads all the Lo-Fi images in this WebContents.
*/
public void reloadLoFiImages();
+
+ /**
+ * Sends a request to download the given image {@link url}.
+ * This method delegates the call to the downloadImage() method of native WebContents.
+ * @param url The URL of the image to download.
+ * @param isFavicon Whether the image is a favicon. If true, the cookies are not sent and not
+ * accepted during download.
+ * @param maxBitmapSize The maximum bitmap size. Bitmaps with pixel sizes larger than {@link
+ * max_bitmap_size} are filtered out from the bitmap results. If there are no
+ * bitmap results <= {@link max_bitmap_size}, the smallest bitmap is resized to
+ * {@link max_bitmap_size} and is the only result. A {@link max_bitmap_size} of
+ * 0 means unlimited.
+ * @param bypassCache If true, {@link url} is requested from the server even if it is present in
+ * the browser cache.
+ * @param callback The callback which will be called when the bitmaps are received from the
+ * renderer.
+ * @return The unique id of the download request
+ */
+ public int downloadImage(String url, boolean isFavicon, int maxBitmapSize,
+ boolean bypassCache, ImageDownloadCallback callback);
}
« no previous file with comments | « content/public/android/java/src/org/chromium/content_public/browser/ImageDownloadCallback.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698