Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Unified Diff: chrome/common/extensions/api/downloads.idl

Issue 11574006: Implement chrome.downloads.onDeterminingFilename() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r176065 Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
};

Powered by Google App Engine
This is Rietveld 408576698