diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-18 10:45:28 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-18 10:45:28 +0000 |
commit | e6be47fb2071a5b0e1859eb014cde64f6c78eb5a (patch) | |
tree | 7503e464d6f75f56bbc2b8603bdb4498fd5459c0 /chrome/browser/history | |
parent | 42a8da22b56bb8d365e605fae75b93bd80965c77 (diff) | |
download | chromium_src-e6be47fb2071a5b0e1859eb014cde64f6c78eb5a.zip chromium_src-e6be47fb2071a5b0e1859eb014cde64f6c78eb5a.tar.gz chromium_src-e6be47fb2071a5b0e1859eb014cde64f6c78eb5a.tar.bz2 |
Option-click to download should not display "Save As" UI.
The download manager has a concept of a request originating from the "Save As..." contextual menu v.s. a direct download request from the renderer, however this was't hooked up.
The Download Manager uses boolean variables named "save_as" in various locations to track whether a download originated via a contextual menu selection (in which case the save panel should be displayed) or via a renderer request (in which case no UI should be displayed).
This CL contains 3 distinct changes:
1. DownloadFileManager::OnDownloadURL() is where downloads originating from the contextual menu are dispatched, set save_as to true if the download starts here.
2. ResourceMessageFilter::OnDownloadURL() is where downloads originating from the renderer are dispatched (e.g. option-click), don't display UI for these.
3. The "save_as" variable in the DownloadCreateInfo structure doesn't really reflect the origin of the request but whether the Save panel should be displayed. This can happen for example on a name collision or if the default download location isn't writeable regardless of the action that initiated the download. Renamed the variable and added documentation to this effect.
BUG=36775
TEST=Option-click an image, the image should be saved without prompting the user for a download locate. Save an image via the "Save As..." context menu, you should be prompted for the save location.
Review URL: http://codereview.chromium.org/2927006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/download_types.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/history/download_types.h b/chrome/browser/history/download_types.h index 4db21e4..642ac5b 100644 --- a/chrome/browser/history/download_types.h +++ b/chrome/browser/history/download_types.h @@ -39,7 +39,7 @@ struct DownloadCreateInfo { render_view_id(-1), request_id(-1), db_handle(0), - save_as(false), + prompt_user_for_save_location(false), is_dangerous(false), is_extension_install(false) { } @@ -54,7 +54,7 @@ struct DownloadCreateInfo { render_view_id(-1), request_id(-1), db_handle(0), - save_as(false), + prompt_user_for_save_location(false), is_dangerous(false), is_extension_install(false) { } @@ -82,7 +82,12 @@ struct DownloadCreateInfo { // may be different from |mime_type|, which may be set based on heuristics // which may look at the file extension and first few bytes of the file. std::string original_mime_type; - bool save_as; + + // True if we should display the 'save as...' UI and prompt the user + // for the download location. + // False if the UI should be supressed and the download performed to the + // default location. + bool prompt_user_for_save_location; // Whether this download is potentially dangerous (ex: exe, dll, ...). bool is_dangerous; // The original name for a dangerous download. |