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

Unified Diff: content/public/android/java/src/org/chromium/content_public/browser/ImageDownloadCallback.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
Index: content/public/android/java/src/org/chromium/content_public/browser/ImageDownloadCallback.java
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/ImageDownloadCallback.java b/content/public/android/java/src/org/chromium/content_public/browser/ImageDownloadCallback.java
new file mode 100644
index 0000000000000000000000000000000000000000..7638273ac93889f0595b02ab781979e928d9aa10
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content_public/browser/ImageDownloadCallback.java
@@ -0,0 +1,29 @@
+// Copyright 2016 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_public.browser;
+
+import android.graphics.Bitmap;
+import android.graphics.Rect;
+
+import java.util.List;
+
+/**
+ * Java counterpart of native ImageDownloadCallback.
+ */
+public interface ImageDownloadCallback {
+ /**
+ * Called when image downloading is completed.
+ * @param id The unique id for the download image request, which corresponds to the return value
+ * of {@link WebContents.DownloadImage}.
+ * @param httpStatusCode The HTTP status code for the download request.
+ * @param imageUrl The URL of the downloaded image.
+ * @param bitmaps The bitmaps from the download image. Note that the bitmaps in the image could
+ * be ignored or resized if they are larger than the size limit in {@link
+ * WebContente.DownloadImage}.
+ * @param originalImageSizes The original sizes of {@link bitmaps} prior to the resizing.
+ */
+ void onFinishDownloadImage(int id, int httpStatusCode, String imageUrl, List<Bitmap> bitmaps,
+ List<Rect> originalImageSizes);
+}

Powered by Google App Engine
This is Rietveld 408576698