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

Issue 7624031: Treat files downloaded from the address bar as "always safe" (including extensions per discussion... (Closed)

Created:
9 years, 4 months ago by Peter Kasting
Modified:
9 years, 3 months ago
CC:
chromium-reviews, Erik does not do reviews, jam, mihaip+watch_chromium.org, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org, rdsmith+dwatch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Treat files downloaded from the address bar as "always safe" (including extensions per discussion with asargent and the extensions folks). This required plumbing the PageTransition::Type from render_view.cc back up through various layers to the download system, as well as adding an extra state qualifier bit on the Type to mark navigations triggered "FROM_ADDRESS_BAR" (since the Type itself sans-qualifier cannot be used to reliably check this). This also fixes an inconsistency in IsDangerousFile() where "auto-open" lowered our safety checks for Dangerous files but not for AllowOnUserGesture files. BUG=87192, 92345 TEST=Paste the PDF link from bug 87192 comment 0 into your address bar and hit enter. The file should download without triggering any warning UI in the download shelf. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98897

Patch Set 1 #

Total comments: 10

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -90 lines) Patch
M chrome/browser/download/chrome_download_manager_delegate.cc View 1 2 3 3 chunks +22 lines, -17 lines 0 comments Download
M chrome/browser/extensions/extension_webnavigation_api.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/user_script_listener_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/metrics/metrics_service.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/browser_navigator.cc View 1 2 3 1 chunk +7 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/gtk/location_bar_view_gtk.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/api/extension_api.json View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/docs/experimental.clear.html View 1 2 3 2 chunks +3 lines, -5 lines 0 comments Download
M content/browser/download/download_create_info.h View 1 2 3 3 chunks +5 lines, -1 line 0 comments Download
M content/browser/download/download_create_info.cc View 1 2 3 3 chunks +4 lines, -1 line 0 comments Download
M content/browser/download/download_item.cc View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M content/browser/download/download_resource_handler.cc View 1 2 3 1 chunk +4 lines, -7 lines 0 comments Download
M content/browser/download/download_state_info.h View 1 2 3 3 chunks +4 lines, -0 lines 0 comments Download
M content/browser/download/download_state_info.cc View 1 2 3 4 chunks +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host.h View 1 2 3 2 chunks +5 lines, -6 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host.cc View 1 2 3 5 chunks +5 lines, -6 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_request_info.h View 1 2 3 4 chunks +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_request_info.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_unittest.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/resource_queue_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M content/common/page_transition_types.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/common/request_extra_data.h View 1 2 3 1 chunk +8 lines, -4 lines 0 comments Download
M content/common/request_extra_data.cc View 1 2 3 1 chunk +7 lines, -4 lines 0 comments Download
M content/common/resource_dispatcher.cc View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M content/common/resource_dispatcher_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/common/resource_messages.h View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M content/renderer/render_view.cc View 1 2 3 3 chunks +21 lines, -19 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Peter Kasting
cevans: chrome_download_manager_delegate.cc rdsmith: All other download system changes asargent: chrome/browser/extensions; IsDangerousFile() changes FYI brettw: browser_navigator.cc, ...
9 years, 4 months ago (2011-08-17 23:08:35 UTC) #1
Peter Kasting
Also brettw/darin, inform me how to proceed w.r.t. check_deps failing on webkit/glue #including "content/common/page_transition_types.h"
9 years, 4 months ago (2011-08-17 23:10:42 UTC) #2
sky
http://codereview.chromium.org/7624031/diff/1/chrome/browser/ui/browser_navigator.cc File chrome/browser/ui/browser_navigator.cc (right): http://codereview.chromium.org/7624031/diff/1/chrome/browser/ui/browser_navigator.cc#newcode370 chrome/browser/ui/browser_navigator.cc:370: bool user_initiated = params->transition & PageTransition::FROM_ADDRESS_BAR || How unlike ...
9 years, 4 months ago (2011-08-18 00:13:00 UTC) #3
asargent_no_longer_on_chrome
LGTM on chrome/browser/extensions/user_script_listener_unittest.cc mpcomplete - can you look at the change to chrome/browser/extensions/extension_webnavigation_api.cc ?
9 years, 4 months ago (2011-08-18 00:13:21 UTC) #4
Matt Perry
http://codereview.chromium.org/7624031/diff/1/chrome/browser/extensions/extension_webnavigation_api.cc File chrome/browser/extensions/extension_webnavigation_api.cc (right): http://codereview.chromium.org/7624031/diff/1/chrome/browser/extensions/extension_webnavigation_api.cc#newcode112 chrome/browser/extensions/extension_webnavigation_api.cc:112: qualifiers->Append(Value::CreateStringValue("from_address_bar")); This changes the API. It seems like a ...
9 years, 4 months ago (2011-08-18 00:22:40 UTC) #5
Peter Kasting
http://codereview.chromium.org/7624031/diff/1/chrome/browser/extensions/extension_webnavigation_api.cc File chrome/browser/extensions/extension_webnavigation_api.cc (right): http://codereview.chromium.org/7624031/diff/1/chrome/browser/extensions/extension_webnavigation_api.cc#newcode112 chrome/browser/extensions/extension_webnavigation_api.cc:112: qualifiers->Append(Value::CreateStringValue("from_address_bar")); On 2011/08/18 00:22:40, Matt Perry wrote: > This ...
9 years, 4 months ago (2011-08-18 00:53:38 UTC) #6
brettw
Yeah, you definitely shouldn't be including stuff from content at this layer... Reading the comment ...
9 years, 4 months ago (2011-08-18 02:48:11 UTC) #7
darin (slow to review)
http://codereview.chromium.org/7624031/diff/1/webkit/glue/resource_loader_bridge.h File webkit/glue/resource_loader_bridge.h (right): http://codereview.chromium.org/7624031/diff/1/webkit/glue/resource_loader_bridge.h#newcode33 webkit/glue/resource_loader_bridge.h:33: #include "content/common/page_transition_types.h" i see... hmm, it certainly seems a ...
9 years, 4 months ago (2011-08-18 04:21:01 UTC) #8
Peter Kasting
http://codereview.chromium.org/7624031/diff/1/webkit/glue/resource_loader_bridge.h File webkit/glue/resource_loader_bridge.h (right): http://codereview.chromium.org/7624031/diff/1/webkit/glue/resource_loader_bridge.h#newcode33 webkit/glue/resource_loader_bridge.h:33: #include "content/common/page_transition_types.h" On 2011/08/18 04:21:01, darin wrote: > i ...
9 years, 4 months ago (2011-08-18 19:47:36 UTC) #9
darin (slow to review)
On Thu, Aug 18, 2011 at 12:47 PM, <pkasting@chromium.org> wrote: > > http://codereview.chromium.**org/7624031/diff/1/webkit/** > glue/resource_loader_bridge.h<http://codereview.chromium.org/7624031/diff/1/webkit/glue/resource_loader_bridge.h> ...
9 years, 4 months ago (2011-08-18 20:18:55 UTC) #10
Randy Smith (Not in Mondays)
Andy, could you take a look at this CL from the downloads perspective? It may ...
9 years, 4 months ago (2011-08-19 15:03:51 UTC) #11
ahendrickson
LGTM with respect to downloads. http://codereview.chromium.org/7624031/diff/1/chrome/browser/download/chrome_download_manager_delegate.cc File chrome/browser/download/chrome_download_manager_delegate.cc (right): http://codereview.chromium.org/7624031/diff/1/chrome/browser/download/chrome_download_manager_delegate.cc#newcode150 chrome/browser/download/chrome_download_manager_delegate.cc:150: &ChromeDownloadManagerDelegate::CheckVisitedReferrerBeforeDone)); Nit: I think ...
9 years, 4 months ago (2011-08-19 15:51:47 UTC) #12
Peter Kasting
http://codereview.chromium.org/7624031/diff/1/chrome/browser/download/chrome_download_manager_delegate.cc File chrome/browser/download/chrome_download_manager_delegate.cc (right): http://codereview.chromium.org/7624031/diff/1/chrome/browser/download/chrome_download_manager_delegate.cc#newcode150 chrome/browser/download/chrome_download_manager_delegate.cc:150: &ChromeDownloadManagerDelegate::CheckVisitedReferrerBeforeDone)); On 2011/08/19 15:51:47, ahendrickson wrote: > Nit: I ...
9 years, 4 months ago (2011-08-19 17:27:37 UTC) #13
sky
chrome/browser/ui/*/location_bar*, page_transition_types.h LGTM http://codereview.chromium.org/7624031/diff/1/chrome/browser/ui/browser_navigator.cc File chrome/browser/ui/browser_navigator.cc (right): http://codereview.chromium.org/7624031/diff/1/chrome/browser/ui/browser_navigator.cc#newcode374 chrome/browser/ui/browser_navigator.cc:374: base_transition == PageTransition::START_PAGE || On 2011/08/18 ...
9 years, 4 months ago (2011-08-19 17:34:34 UTC) #14
Peter Kasting
New snap up. Still need review: cevans: chrome_download_manager_delegate.cc mpcomplete: chrome/common/extensions/{api,docs} changes brettw: browser_navigator.cc, page_transition_types.h darin: ...
9 years, 4 months ago (2011-08-26 18:51:53 UTC) #15
Matt Perry
lgtm
9 years, 4 months ago (2011-08-26 18:56:42 UTC) #16
brettw
browser_navigator & page_transition_types LGTM
9 years, 4 months ago (2011-08-26 19:26:41 UTC) #17
darin (slow to review)
LGTM
9 years, 3 months ago (2011-08-29 19:56:40 UTC) #18
Chris Evans
9 years, 3 months ago (2011-08-30 23:49:05 UTC) #19
On 2011/08/29 19:56:40, darin wrote:
> LGTM

LGTM. Sorry for the holdup.

Powered by Google App Engine
This is Rietveld 408576698