Index: chrome/common/extensions/api/downloads.idl |
diff --git a/chrome/common/extensions/api/downloads.idl b/chrome/common/extensions/api/downloads.idl |
index b6ca8d6c204e46bdc9ef99a4f25a961d06c34c83..fa5629573bc38904685d36bda1d51364d17cb73f 100644 |
--- a/chrome/common/extensions/api/downloads.idl |
+++ b/chrome/common/extensions/api/downloads.idl |
@@ -12,6 +12,17 @@ namespace downloads { |
DOMString value; |
}; |
+ // $ref:onDeterminingFilename handlers may return a FilenameDetermination |
+ // object in order to override a download's target filename. |
+ dictionary FilenameDetermination { |
+ // The download's new target filename. |
+ DOMString filename; |
+ |
+ // Whether to overwrite any existing files. Ignored if <code>filename</code> |
+ // is unset. |
Randy Smith (Not in Mondays)
2013/01/14 21:02:29
Sorry, probably still confused about syntax, but d
benjhayden
2013/01/17 02:52:05
Done.
Randy Smith (Not in Mondays)
2013/01/17 19:15:42
Still confused, Milo. Does this mean that the ext
benjhayden
2013/01/18 20:59:50
Not quite. See about L60 in https://codereview.chr
Randy Smith (Not in Mondays)
2013/01/22 19:43:07
Ok.
|
+ boolean? overwrite; |
+ }; |
+ |
[inline_doc] enum HttpMethod {GET, POST}; |
[inline_doc] dictionary DownloadOptions { |
@@ -393,9 +404,6 @@ namespace downloads { |
// then <code>callback</code> will be called. |
static void erase(DownloadQuery query, optional EraseCallback callback); |
- // TODO(benjhayden) Comment. |
- [nodoc] static void setDestination(long downloadId, DOMString relativePath); |
- |
// Prompt the user to either accept or cancel a dangerous download. |
// <code>acceptDanger()</code> does not automatically accept dangerous |
// downloads. |
@@ -419,5 +427,15 @@ namespace downloads { |
// except <code>bytesReceived</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 |
+ // opportunity to override the target filename. Handlers may return null in |
+ // order to allow the target filename to be used, or return a |
+ // $ref:FilenameDetermination object in order to override the target |
+ // filename. If more than one extension overrides the filename, then one |
+ // extension will win. There is no way to predict or choose which extension |
+ // will win. Users should be careful to not install extensions that may |
+ // conflict. |
+ static void onDeterminingFilename(DownloadItem downloadItem); |
Randy Smith (Not in Mondays)
2013/01/14 21:02:29
This is solidly and definitely me not understandin
benjhayden
2013/01/17 02:52:05
The return values are always ignored in IDL.
|
}; |
}; |