OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // Use the <code>chrome.downloads</code> API to programmatically initiate, | 5 // Use the <code>chrome.downloads</code> API to programmatically initiate, |
6 // monitor, manipulate, and search for downloads. | 6 // monitor, manipulate, and search for downloads. |
7 [permissions=downloads] | 7 [permissions=downloads] |
8 namespace downloads { | 8 namespace downloads { |
9 [inline_doc] dictionary HeaderNameValuePair { | 9 [inline_doc] dictionary HeaderNameValuePair { |
10 // Name of the HTTP header. | 10 // Name of the HTTP header. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // <dd>The download completed successfully.</dd> | 126 // <dd>The download completed successfully.</dd> |
127 // </dl> | 127 // </dl> |
128 enum State {in_progress, interrupted, complete}; | 128 enum State {in_progress, interrupted, complete}; |
129 | 129 |
130 // The state of the process of downloading a file. | 130 // The state of the process of downloading a file. |
131 dictionary DownloadItem { | 131 dictionary DownloadItem { |
132 // An identifier that is persistent across browser sessions. | 132 // An identifier that is persistent across browser sessions. |
133 long id; | 133 long id; |
134 | 134 |
135 // Absolute URL. | 135 // Absolute URL. |
| 136 // URL that this download started from (before any redirects). |
136 DOMString url; | 137 DOMString url; |
137 | 138 |
138 // Absolute URL. | 139 // Absolute URL. |
| 140 // Actual download URL (final url in chain after all redirects). |
| 141 DOMString finalUrl; |
| 142 |
| 143 // Absolute URL. |
139 DOMString referrer; | 144 DOMString referrer; |
140 | 145 |
141 // Absolute local path. | 146 // Absolute local path. |
142 DOMString filename; | 147 DOMString filename; |
143 | 148 |
144 // False if this download is recorded in the history, true if it is not | 149 // False if this download is recorded in the history, true if it is not |
145 // recorded. | 150 // recorded. |
146 boolean incognito; | 151 boolean incognito; |
147 | 152 |
148 // Indication of whether this download is thought to be safe or known to be | 153 // Indication of whether this download is thought to be safe or known to be |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 double? totalBytesLess; | 259 double? totalBytesLess; |
255 | 260 |
256 // Limits results to $(ref:DownloadItem) whose | 261 // Limits results to $(ref:DownloadItem) whose |
257 // <code>filename</code> matches the given regular expression. | 262 // <code>filename</code> matches the given regular expression. |
258 DOMString? filenameRegex; | 263 DOMString? filenameRegex; |
259 | 264 |
260 // Limits results to $(ref:DownloadItem) whose | 265 // Limits results to $(ref:DownloadItem) whose |
261 // <code>url</code> matches the given regular expression. | 266 // <code>url</code> matches the given regular expression. |
262 DOMString? urlRegex; | 267 DOMString? urlRegex; |
263 | 268 |
| 269 // Limits results to $(ref:DownloadItem) whose |
| 270 // <code>finalUrl</code> matches the given regular expression. |
| 271 DOMString? finalUrlRegex; |
| 272 |
264 // The maximum number of matching $(ref:DownloadItem) returned. Defaults to | 273 // The maximum number of matching $(ref:DownloadItem) returned. Defaults to |
265 // 1000. Set to 0 in order to return all matching $(ref:DownloadItem). See | 274 // 1000. Set to 0 in order to return all matching $(ref:DownloadItem). See |
266 // $(ref:search) for how to page through results. | 275 // $(ref:search) for how to page through results. |
267 long? limit; | 276 long? limit; |
268 | 277 |
269 // Set elements of this array to $(ref:DownloadItem) properties in order to | 278 // Set elements of this array to $(ref:DownloadItem) properties in order to |
270 // sort search results. For example, setting | 279 // sort search results. For example, setting |
271 // <code>orderBy=['startTime']</code> sorts the $(ref:DownloadItem) by their | 280 // <code>orderBy=['startTime']</code> sorts the $(ref:DownloadItem) by their |
272 // start time in ascending order. To specify descending order, prefix with a | 281 // start time in ascending order. To specify descending order, prefix with a |
273 // hyphen: '-startTime'. | 282 // hyphen: '-startTime'. |
274 DOMString[]? orderBy; | 283 DOMString[]? orderBy; |
275 | 284 |
276 // The <code>id</code> of the $(ref:DownloadItem) to query. | 285 // The <code>id</code> of the $(ref:DownloadItem) to query. |
277 long? id; | 286 long? id; |
278 | 287 |
279 // Absolute URL. | 288 // Absolute URL. |
| 289 // URL that this download started from (before any redirects). |
280 DOMString? url; | 290 DOMString? url; |
281 | 291 |
| 292 // Absolute URL. |
| 293 // Actual download URL (final url in chain after all redirects). |
| 294 DOMString? finalUrl; |
| 295 |
282 // Absolute local path. | 296 // Absolute local path. |
283 DOMString? filename; | 297 DOMString? filename; |
284 | 298 |
285 // Indication of whether this download is thought to be safe or known to be | 299 // Indication of whether this download is thought to be safe or known to be |
286 // suspicious. | 300 // suspicious. |
287 DangerType? danger; | 301 DangerType? danger; |
288 | 302 |
289 // The file's MIME type. | 303 // The file's MIME type. |
290 DOMString? mime; | 304 DOMString? mime; |
291 | 305 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 351 |
338 // Encapsulates a change in a DownloadItem. | 352 // Encapsulates a change in a DownloadItem. |
339 [inline_doc] dictionary DownloadDelta { | 353 [inline_doc] dictionary DownloadDelta { |
340 // The <code>id</code> of the $(ref:DownloadItem) | 354 // The <code>id</code> of the $(ref:DownloadItem) |
341 // that changed. | 355 // that changed. |
342 long id; | 356 long id; |
343 | 357 |
344 // The change in <code>url</code>, if any. | 358 // The change in <code>url</code>, if any. |
345 StringDelta? url; | 359 StringDelta? url; |
346 | 360 |
| 361 // The change in <code>finalUrl</code>, if any. |
| 362 StringDelta? finalUrl; |
| 363 |
347 // The change in <code>filename</code>, if any. | 364 // The change in <code>filename</code>, if any. |
348 StringDelta? filename; | 365 StringDelta? filename; |
349 | 366 |
350 // The change in <code>danger</code>, if any. | 367 // The change in <code>danger</code>, if any. |
351 StringDelta? danger; | 368 StringDelta? danger; |
352 | 369 |
353 // The change in <code>mime</code>, if any. | 370 // The change in <code>mime</code>, if any. |
354 StringDelta? mime; | 371 StringDelta? mime; |
355 | 372 |
356 // The change in <code>startTime</code>, if any. | 373 // The change in <code>startTime</code>, if any. |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // <code>suggestion</code> object to <code>suggest</code> wins. In order to | 559 // <code>suggestion</code> object to <code>suggest</code> wins. In order to |
543 // avoid confusion regarding which extension will win, users should not | 560 // avoid confusion regarding which extension will win, users should not |
544 // install extensions that may conflict. If the download is initiated by | 561 // install extensions that may conflict. If the download is initiated by |
545 // $(ref:download) and the target filename is known before the MIME type and | 562 // $(ref:download) and the target filename is known before the MIME type and |
546 // tentative filename have been determined, pass <code>filename</code> to | 563 // tentative filename have been determined, pass <code>filename</code> to |
547 // $(ref:download) instead. | 564 // $(ref:download) instead. |
548 [maxListeners=1] static void onDeterminingFilename( | 565 [maxListeners=1] static void onDeterminingFilename( |
549 DownloadItem downloadItem, SuggestFilenameCallback suggest); | 566 DownloadItem downloadItem, SuggestFilenameCallback suggest); |
550 }; | 567 }; |
551 }; | 568 }; |
OLD | NEW |