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..fa9f5181cf1a51f34cb78909d0ea388a7c671141 100644 |
--- a/chrome/common/extensions/api/downloads.idl |
+++ b/chrome/common/extensions/api/downloads.idl |
@@ -12,6 +12,16 @@ 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. |
Randy Smith (Not in Mondays)
2013/01/22 19:43:08
Should we specify that the filename is considered
benjhayden
2013/01/23 21:30:10
Done.
|
+ DOMString filename; |
+ |
+ // Whether to overwrite any existing files. |
+ boolean? overwrite; |
+ }; |
+ |
[inline_doc] enum HttpMethod {GET, POST}; |
[inline_doc] dictionary DownloadOptions { |
@@ -393,9 +403,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 +426,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); |
}; |
}; |