summaryrefslogtreecommitdiffstats
path: root/content/public/android/java/src/org/chromium/content/browser/ContentViewDownloadDelegate.java
blob: 4caff13e28884a60925727b78d241232b0a0abc8 (plain)
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
34
35
36
37
38
39
40
// Copyright 2012 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.browser;

/**
 * Interface to be implemented by the embedder to handle file downloads.
 */
public interface ContentViewDownloadDelegate {
    /**
    * Notify the host application that a file should be downloaded. Replaces
    * onDownloadStart from DownloadListener.
    * @param downloadInfo Information about the requested download.
    */
    void requestHttpGetDownload(DownloadInfo downloadInfo);

    /**
     * Notify the host application that a download is started.
     * @param filename File name of the downloaded file.
     * @param mimeType Mime of the downloaded item.
     */
    void onDownloadStarted(String filename, String mimeType);

    /**
     * Notify the host application that a download has an extension indicating
     * a dangerous file type.
     * @param filename File name of the downloaded file.
     * @param downloadId The download id.
     */
    void onDangerousDownload(String filename, int downloadId);

    /**
     * Called when file access has been requested to complete a download.
     * @param callbackId The callback ID used to trigger success or failure of the download.
     *
     * @see DownloadController#onRequestFileAccessResult(long, boolean)
     */
    void requestFileAccess(long callbackId);
}