Index: chrome/common/extensions/api/downloads.idl |
diff --git a/chrome/common/extensions/api/downloads.idl b/chrome/common/extensions/api/downloads.idl |
index 3481229557c8b584baa89938e798e6907fc71110..0c8842e86334b2d79faad5f6fc16df546249cd46 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. |
+ DOMString? filename; |
+ |
+ // Whether to overwrite any existing files. |
+ boolean? overwrite; |
+ }; |
+ |
[inline_doc] enum HttpMethod {GET, POST}; |
[inline_doc] dictionary DownloadOptions { |
@@ -376,9 +386,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. |
@@ -402,5 +409,12 @@ 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. |
+ static void onDeterminingFilename(DownloadItem downloadItem); |
}; |
}; |