Chromium Code Reviews| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 // <dd>The download completed successfully.</dd> | 128 // <dd>The download completed successfully.</dd> |
| 129 // </dl> | 129 // </dl> |
| 130 enum State {in_progress, interrupted, complete}; | 130 enum State {in_progress, interrupted, complete}; |
| 131 | 131 |
| 132 // The state of the process of downloading a file. | 132 // The state of the process of downloading a file. |
| 133 dictionary DownloadItem { | 133 dictionary DownloadItem { |
| 134 // An identifier that is persistent across browser sessions. | 134 // An identifier that is persistent across browser sessions. |
| 135 long id; | 135 long id; |
| 136 | 136 |
| 137 // Absolute URL. | 137 // Absolute URL. |
| 138 // URL that this download started from (before any redirects). | |
|
asargent_no_longer_on_chrome
2016/06/16 22:11:41
nit: in the autogenerated documentation at https:/
mharanczyk
2016/06/23 10:33:21
Done.
| |
| 138 DOMString url; | 139 DOMString url; |
| 139 | 140 |
| 140 // Absolute URL. | 141 // Absolute URL. |
| 142 // Actual download URL (final url in chain after all redirects). | |
|
asargent_no_longer_on_chrome
2016/06/16 22:11:40
same nit here
mharanczyk
2016/06/23 10:33:21
Done.
| |
| 143 DOMString finalUrl; | |
| 144 | |
| 145 // Absolute URL. | |
| 141 DOMString referrer; | 146 DOMString referrer; |
| 142 | 147 |
| 143 // Absolute local path. | 148 // Absolute local path. |
| 144 DOMString filename; | 149 DOMString filename; |
| 145 | 150 |
| 146 // False if this download is recorded in the history, true if it is not | 151 // False if this download is recorded in the history, true if it is not |
| 147 // recorded. | 152 // recorded. |
| 148 boolean incognito; | 153 boolean incognito; |
| 149 | 154 |
| 150 // Indication of whether this download is thought to be safe or known to be | 155 // 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... | |
| 256 double? totalBytesLess; | 261 double? totalBytesLess; |
| 257 | 262 |
| 258 // Limits results to $(ref:DownloadItem) whose | 263 // Limits results to $(ref:DownloadItem) whose |
| 259 // <code>filename</code> matches the given regular expression. | 264 // <code>filename</code> matches the given regular expression. |
| 260 DOMString? filenameRegex; | 265 DOMString? filenameRegex; |
| 261 | 266 |
| 262 // Limits results to $(ref:DownloadItem) whose | 267 // Limits results to $(ref:DownloadItem) whose |
| 263 // <code>url</code> matches the given regular expression. | 268 // <code>url</code> matches the given regular expression. |
| 264 DOMString? urlRegex; | 269 DOMString? urlRegex; |
| 265 | 270 |
| 271 // Limits results to $(ref:DownloadItem) whose | |
| 272 // <code>finalUrl</code> matches the given regular expression. | |
| 273 DOMString? finalUrlRegex; | |
| 274 | |
| 266 // The maximum number of matching $(ref:DownloadItem) returned. Defaults to | 275 // The maximum number of matching $(ref:DownloadItem) returned. Defaults to |
| 267 // 1000. Set to 0 in order to return all matching $(ref:DownloadItem). See | 276 // 1000. Set to 0 in order to return all matching $(ref:DownloadItem). See |
| 268 // $(ref:search) for how to page through results. | 277 // $(ref:search) for how to page through results. |
| 269 long? limit; | 278 long? limit; |
| 270 | 279 |
| 271 // Set elements of this array to $(ref:DownloadItem) properties in order to | 280 // Set elements of this array to $(ref:DownloadItem) properties in order to |
| 272 // sort search results. For example, setting | 281 // sort search results. For example, setting |
| 273 // <code>orderBy=['startTime']</code> sorts the $(ref:DownloadItem) by their | 282 // <code>orderBy=['startTime']</code> sorts the $(ref:DownloadItem) by their |
| 274 // start time in ascending order. To specify descending order, prefix with a | 283 // start time in ascending order. To specify descending order, prefix with a |
| 275 // hyphen: '-startTime'. | 284 // hyphen: '-startTime'. |
| 276 DOMString[]? orderBy; | 285 DOMString[]? orderBy; |
| 277 | 286 |
| 278 // The <code>id</code> of the $(ref:DownloadItem) to query. | 287 // The <code>id</code> of the $(ref:DownloadItem) to query. |
| 279 long? id; | 288 long? id; |
| 280 | 289 |
| 281 // Absolute URL. | 290 // Absolute URL. |
| 291 // URL that this download started from (before any redirects). | |
| 282 DOMString? url; | 292 DOMString? url; |
| 283 | 293 |
| 294 // Absolute URL. | |
| 295 // Actual download URL (final url in chain after all redirects). | |
|
asargent_no_longer_on_chrome
2016/06/16 22:11:41
same nit here
mharanczyk
2016/06/23 10:33:21
Done.
| |
| 296 DOMString? finalUrl; | |
| 297 | |
| 284 // Absolute local path. | 298 // Absolute local path. |
| 285 DOMString? filename; | 299 DOMString? filename; |
| 286 | 300 |
| 287 // Indication of whether this download is thought to be safe or known to be | 301 // Indication of whether this download is thought to be safe or known to be |
| 288 // suspicious. | 302 // suspicious. |
| 289 DangerType? danger; | 303 DangerType? danger; |
| 290 | 304 |
| 291 // The file's MIME type. | 305 // The file's MIME type. |
| 292 DOMString? mime; | 306 DOMString? mime; |
| 293 | 307 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 | 353 |
| 340 // Encapsulates a change in a DownloadItem. | 354 // Encapsulates a change in a DownloadItem. |
| 341 [inline_doc] dictionary DownloadDelta { | 355 [inline_doc] dictionary DownloadDelta { |
| 342 // The <code>id</code> of the $(ref:DownloadItem) | 356 // The <code>id</code> of the $(ref:DownloadItem) |
| 343 // that changed. | 357 // that changed. |
| 344 long id; | 358 long id; |
| 345 | 359 |
| 346 // The change in <code>url</code>, if any. | 360 // The change in <code>url</code>, if any. |
| 347 StringDelta? url; | 361 StringDelta? url; |
| 348 | 362 |
| 363 // The change in <code>finalUrl</code>, if any. | |
|
asargent_no_longer_on_chrome
2016/06/16 22:11:41
It would be useful to mention here how finalUrl ca
asanka
2016/06/22 19:05:13
Neither url nor finalUrl can change for a download
mharanczyk
2016/06/23 10:33:21
So in what way should be this handled?
1. Just rem
asargent_no_longer_on_chrome
2016/06/23 16:35:52
I think it's fine to remove any optional elements
mharanczyk
2016/06/28 13:15:32
As it turn out those delta fields are actually set
asanka
2016/06/28 13:39:45
FTR, both of those behaviors are incorrect. Report
| |
| 364 StringDelta? finalUrl; | |
| 365 | |
| 349 // The change in <code>filename</code>, if any. | 366 // The change in <code>filename</code>, if any. |
| 350 StringDelta? filename; | 367 StringDelta? filename; |
| 351 | 368 |
| 352 // The change in <code>danger</code>, if any. | 369 // The change in <code>danger</code>, if any. |
| 353 StringDelta? danger; | 370 StringDelta? danger; |
| 354 | 371 |
| 355 // The change in <code>mime</code>, if any. | 372 // The change in <code>mime</code>, if any. |
| 356 StringDelta? mime; | 373 StringDelta? mime; |
| 357 | 374 |
| 358 // The change in <code>startTime</code>, if any. | 375 // The change in <code>startTime</code>, if any. |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 // <code>suggestion</code> object to <code>suggest</code> wins. In order to | 561 // <code>suggestion</code> object to <code>suggest</code> wins. In order to |
| 545 // avoid confusion regarding which extension will win, users should not | 562 // avoid confusion regarding which extension will win, users should not |
| 546 // install extensions that may conflict. If the download is initiated by | 563 // install extensions that may conflict. If the download is initiated by |
| 547 // $(ref:download) and the target filename is known before the MIME type and | 564 // $(ref:download) and the target filename is known before the MIME type and |
| 548 // tentative filename have been determined, pass <code>filename</code> to | 565 // tentative filename have been determined, pass <code>filename</code> to |
| 549 // $(ref:download) instead. | 566 // $(ref:download) instead. |
| 550 [maxListeners=1] static void onDeterminingFilename( | 567 [maxListeners=1] static void onDeterminingFilename( |
| 551 DownloadItem downloadItem, SuggestFilenameCallback suggest); | 568 DownloadItem downloadItem, SuggestFilenameCallback suggest); |
| 552 }; | 569 }; |
| 553 }; | 570 }; |
| OLD | NEW |