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

Issue 2927006: Option-click to download should not display "Save As" UI. (Closed)

Created:
10 years, 5 months ago by jeremy
Modified:
9 years, 6 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, Paul Godavari, darin-cc_chromium.org, ben+cc_chromium.org, pink (ping after 24hrs)
Visibility:
Public.

Description

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. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=52848

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -15 lines) Patch
M chrome/browser/download/download_file.cc View 1 chunk +3 lines, -0 lines 1 comment Download
M chrome/browser/download/download_manager.cc View 9 chunks +13 lines, -10 lines 0 comments Download
M chrome/browser/history/download_types.h View 3 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/download_resource_handler.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
jeremy
Jay,Evan: Just need a review from one of you :o) Adam: I'm concerned that there ...
10 years, 5 months ago (2010-07-12 11:37:19 UTC) #1
Jay Civelli
10 years, 5 months ago (2010-07-12 22:51:44 UTC) #2
LGTM

http://codereview.chromium.org/2927006/diff/1/2
File chrome/browser/download/download_file.cc (right):

http://codereview.chromium.org/2927006/diff/1/2#newcode588
chrome/browser/download/download_file.cc:588: bool prompt_for_save_location =
true;
Nit: are you using a local var for commenting purpose? Couldn't you pass true
and comment the parameter instead?

Powered by Google App Engine
This is Rietveld 408576698