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

Unified Diff: chrome/common/extensions/api/downloads.idl

Issue 16924017: A few minor changes to the chrome.downloads extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r208716 Created 7 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: chrome/common/extensions/api/downloads.idl
diff --git a/chrome/common/extensions/api/downloads.idl b/chrome/common/extensions/api/downloads.idl
index af6eac15c19f965681d6178197bef9d32e4b54a8..ea6371107ae60c0fa291cf2d2815391458c13d45 100644
--- a/chrome/common/extensions/api/downloads.idl
+++ b/chrome/common/extensions/api/downloads.idl
@@ -100,6 +100,9 @@ namespace downloads {
// Absolute URL.
DOMString url;
+ // Absolute URL.
+ DOMString referrer;
+
// Absolute local path.
DOMString filename;
@@ -111,9 +114,6 @@ namespace downloads {
// suspicious.
DangerType danger;
- // True if the user has accepted the download's danger.
- boolean? dangerAccepted;
-
// The file's MIME type.
DOMString mime;
@@ -129,6 +129,9 @@ namespace downloads {
// console.log(new Date(item.endTime))})})</code>
DOMString? endTime;
+ // Estimated time when the download will complete in ISO 8601 format.
+ DOMString? estimatedEndTime;
+
// Indicates whether the download is progressing, interrupted, or complete.
State state;
@@ -136,6 +139,10 @@ namespace downloads {
// connection open.
boolean paused;
+ // True if the download is in progress and paused, or else if it is
+ // interrupted and can be resumed starting from where it was interrupted.
+ boolean canResume;
+
// Number indicating why a download was interrupted.
long? error;
@@ -228,9 +235,6 @@ namespace downloads {
// suspicious.
DangerType? danger;
- // True if the user has accepted the download's danger.
- boolean? dangerAccepted;
-
// The file's MIME type.
DOMString? mime;
@@ -295,9 +299,6 @@ namespace downloads {
// The change in <code>danger</code>, if any.
StringDelta? danger;
- // The change in <code>dangerAccepted</code>, if any.
- BooleanDelta? dangerAccepted;
-
// The change in <code>mime</code>, if any.
StringDelta? mime;
@@ -310,6 +311,9 @@ namespace downloads {
// The change in <code>state</code>, if any.
StringDelta? state;
+ // The change in <code>canResume</code>, if any.
+ BooleanDelta? canResume;
+
// The change in <code>paused</code>, if any.
BooleanDelta? paused;
@@ -412,9 +416,11 @@ namespace downloads {
// |downloadId|: The identifier for the downloaded file.
static void open(long downloadId);
- // Show the downloaded file in its folder in a file manager.
+ // Show the downloaded file in its folder in a file manager. If
+ // <code>downloadId</code> is not specified, opens the default Downloads
+ // folder in a file manager.
// |downloadId|: The identifier for the downloaded file.
- static void show(long downloadId);
+ static void show(optional long downloadId);
// Erase matching $ref:DownloadItem from history. An $ref:onErased event
// will fire for each $ref:DownloadItem that matches <code>query</code>,
@@ -429,7 +435,8 @@ namespace downloads {
// renamed to the target filename, the |state| changes to 'complete', and
// $ref:onChanged fires.
// |downloadId|: The identifier for the $ref:DownloadItem.
- static void acceptDanger(long downloadId);
+ // |callback|: Called when the danger prompt dialog closes.
+ static void acceptDanger(long downloadId, optional NullCallback callback);
// Initiate dragging the downloaded file to another application.
static void drag(long downloadId);
@@ -447,9 +454,9 @@ namespace downloads {
static void onErased(long downloadId);
// When any of a $ref:DownloadItem's properties except
- // <code>bytesReceived</code> changes, this event fires with the
- // <code>downloadId</code> and an object containing the properties that
- // changed.
+ // <code>bytesReceived</code> and <code>estimatedEndTime</code> changes,
+ // this event fires with the <code>downloadId</code> and an object
+ // containing the properties that changed.
static void onChanged(DownloadDelta downloadDelta);
// During the filename determination process, extensions will be given the

Powered by Google App Engine
This is Rietveld 408576698