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 [permissions=downloads] | 5 [permissions=downloads] |
| 6 namespace downloads { | 6 namespace downloads { |
| 7 [inline_doc] dictionary HeaderNameValuePair { | 7 [inline_doc] dictionary HeaderNameValuePair { |
| 8 // Name of the HTTP header. | 8 // Name of the HTTP header. |
| 9 DOMString name; | 9 DOMString name; |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 // $ref:onDeterminingFilename listeners may pass a $ref:FilenameSuggestion | 25 // $ref:onDeterminingFilename listeners may pass a $ref:FilenameSuggestion |
| 26 // object to <code>suggest()</code> in order to override a download's target | 26 // object to <code>suggest()</code> in order to override a download's target |
| 27 // filename. | 27 // filename. |
| 28 [inline_doc] dictionary FilenameSuggestion { | 28 [inline_doc] dictionary FilenameSuggestion { |
| 29 // The $ref:DownloadItem's new target $ref:DownloadItem.filename, as a path | 29 // The $ref:DownloadItem's new target $ref:DownloadItem.filename, as a path |
| 30 // relative to the user's default Downloads directory, possibly containing | 30 // relative to the user's default Downloads directory, possibly containing |
| 31 // subdirectories. Absolute paths, empty paths, and paths containing | 31 // subdirectories. Absolute paths, empty paths, and paths containing |
| 32 // back-references ".." will be ignored. | 32 // back-references ".." will be ignored. |
| 33 DOMString filename; | 33 DOMString filename; |
| 34 | 34 |
| 35 // The action to take if $ref:FilenameSuggestion.filename already exists. | 35 // The action to take if $ref:FilenameSuggestion.filename already exists. |
|
benjhayden
2013/04/17 13:28:18
<code>filename</code>
jshumway
2013/04/18 01:14:19
Got the replacement and another. I wonder why thes
benjhayden
2013/04/18 15:08:46
It might be good to figure this out before committ
| |
| 36 FilenameConflictAction? conflict_action; | 36 FilenameConflictAction? conflict_action; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 [inline_doc] enum HttpMethod {GET, POST}; | 39 [inline_doc] enum HttpMethod {GET, POST}; |
| 40 | 40 |
| 41 [inline_doc] dictionary DownloadOptions { | 41 [inline_doc] dictionary DownloadOptions { |
| 42 // The URL to download. | 42 // The URL to download. |
| 43 DOMString url; | 43 DOMString url; |
| 44 | 44 |
| 45 // A file path relative to the Downloads directory to contain the downloaded | 45 // A file path relative to the Downloads directory to contain the downloaded |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 458 // extension may not register more than one listener for this event. Each | 458 // extension may not register more than one listener for this event. Each |
| 459 // listener must call <code>suggest</code> exactly once, either | 459 // listener must call <code>suggest</code> exactly once, either |
| 460 // synchronously or asynchronously. If the listener calls | 460 // synchronously or asynchronously. If the listener calls |
| 461 // <code>suggest</code> asynchronously, then it must return | 461 // <code>suggest</code> asynchronously, then it must return |
| 462 // <code>true</code>. If the listener neither calls <code>suggest</code> | 462 // <code>true</code>. If the listener neither calls <code>suggest</code> |
| 463 // synchronously nor returns <code>true</code>, then <code>suggest</code> | 463 // synchronously nor returns <code>true</code>, then <code>suggest</code> |
| 464 // will be called automatically. The $ref:DownloadItem will not complete | 464 // will be called automatically. The $ref:DownloadItem will not complete |
| 465 // until all listeners have called <code>suggest</code>. Listeners may call | 465 // until all listeners have called <code>suggest</code>. Listeners may call |
| 466 // <code>suggest</code> without any arguments in order to allow the download | 466 // <code>suggest</code> without any arguments in order to allow the download |
| 467 // to use <code>downloadItem.filename</code> for its filename, or pass a | 467 // to use <code>downloadItem.filename</code> for its filename, or pass a |
| 468 // $ref:FilenameSuggestion object to <code>suggest</code> in order to | 468 // <code>FilenameSuggestion</code> object to <code>suggest</code> in order |
| 469 // override the target filename. If more than one extension overrides the | 469 // to override the target filename. If more than one extension overrides the |
| 470 // filename, then the last extension installed whose listener passes a | 470 // filename, then the last extension installed whose listener passes a |
| 471 // $ref:FilenameSuggestion object to <code>suggest</code> wins. In order to | 471 // <code>FilenameSuggestion</code> object to <code>suggest</code> wins. In |
| 472 // avoid confusion regarding which extension will win, users should not | 472 // order to avoid confusion regarding which extension will win, users should |
| 473 // install extensions that may conflict. If the download is initiated by | 473 // not install extensions that may conflict. If the download is initiated by |
| 474 // $ref:download and the target filename is known before the MIME type and | 474 // $ref:download and the target filename is known before the MIME type and |
| 475 // tentative filename have been determined, use | 475 // tentative filename have been determined, use |
| 476 // $ref:DownloadOptions.filename instead. | 476 // <code>DownloadOptions.filename</code> instead. |
| 477 [maxListeners=1] static void onDeterminingFilename( | 477 [maxListeners=1] static void onDeterminingFilename( |
| 478 DownloadItem downloadItem, SuggestFilenameCallback suggest); | 478 DownloadItem downloadItem, SuggestFilenameCallback suggest); |
| 479 }; | 479 }; |
| 480 }; | 480 }; |
| OLD | NEW |