1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33

content / public / android / java / src / org / chromium / content_public / browser / ImageDownloadCallback.java [blame]

// Copyright 2016 The Chromium Authors
// 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 org.chromium.url.GURL;

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,
            GURL imageUrl,
            List<Bitmap> bitmaps,
            List<Rect> originalImageSizes);
}