| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Interface to be implemented by the embedder to handle file downloads. | 8 * Interface to be implemented by the embedder to handle file downloads. |
| 9 */ | 9 */ |
| 10 public interface ContentViewDownloadDelegate { | 10 public interface ContentViewDownloadDelegate { |
| 11 /** | 11 /** |
| 12 * Notify the host application that a file should be downloaded. Replaces | 12 * Notify the host application that a file should be downloaded. Replaces |
| 13 * onDownloadStart from DownloadListener. | 13 * onDownloadStart from DownloadListener. |
| 14 * @param downloadInfo Information about the requested download. | 14 * @param downloadInfo Information about the requested download. |
| 15 * @param mustDownload Whether the content must be downloded. If chrome canno
t resolve a MIME |
| 16 * type, clicking a link will trigger a download. mustDow
nload is false if |
| 17 * the link has no download attribute and content-disposi
tion is not |
| 18 * attachment. |
| 15 */ | 19 */ |
| 16 void requestHttpGetDownload(DownloadInfo downloadInfo); | 20 void requestHttpGetDownload(DownloadInfo downloadInfo, boolean mustDownload)
; |
| 17 | 21 |
| 18 /** | 22 /** |
| 19 * Notify the host application that a download is started. | 23 * Notify the host application that a download is started. |
| 20 * @param filename File name of the downloaded file. | 24 * @param filename File name of the downloaded file. |
| 21 * @param mimeType Mime of the downloaded item. | 25 * @param mimeType Mime of the downloaded item. |
| 22 */ | 26 */ |
| 23 void onDownloadStarted(String filename, String mimeType); | 27 void onDownloadStarted(String filename, String mimeType); |
| 24 | 28 |
| 25 /** | 29 /** |
| 26 * Notify the host application that a download has an extension indicating | 30 * Notify the host application that a download has an extension indicating |
| 27 * a dangerous file type. | 31 * a dangerous file type. |
| 28 * @param filename File name of the downloaded file. | 32 * @param filename File name of the downloaded file. |
| 29 * @param downloadGuid The download GUID. | 33 * @param downloadGuid The download GUID. |
| 30 */ | 34 */ |
| 31 void onDangerousDownload(String filename, String downloadGuid); | 35 void onDangerousDownload(String filename, String downloadGuid); |
| 32 | 36 |
| 33 /** | 37 /** |
| 34 * Called when file access has been requested to complete a download. | 38 * Called when file access has been requested to complete a download. |
| 35 * @param callbackId The callback ID used to trigger success or failure of t
he download. | 39 * @param callbackId The callback ID used to trigger success or failure of t
he download. |
| 36 * | 40 * |
| 37 * @see DownloadController#onRequestFileAccessResult(long, boolean) | 41 * @see DownloadController#onRequestFileAccessResult(long, boolean) |
| 38 */ | 42 */ |
| 39 void requestFileAccess(long callbackId); | 43 void requestFileAccess(long callbackId); |
| 40 } | 44 } |
| OLD | NEW |