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

Issue 6871020: Added functionality to use "SaveAs..." from PDF plugin. (Closed)

Created:
9 years, 8 months ago by gene
Modified:
9 years, 6 months ago
Reviewers:
cevans, jam, Chris Evans
CC:
chromium-reviews, Avi (use Gerrit), Paweł Hajdan Jr., jam, darin-cc_chromium.org, brettw-cc_chromium.org, piman+watch_chromium.org
Visibility:
Public.

Description

Added functionality to use "SaveAs..." from PDF plugin. It is exactly the same experience as user right-click and select "SaveAs..." from pop-up menu. No disk access allowed for plugin. DIscussed it with Chris Evans and he is ok with this solution from the security stand point. Also added PDF resources for new UI. BUG=56072, 75235 TEST=none, will send PDF cl separately. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=81822

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 2

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -22 lines) Patch
M chrome/browser/ui/download/download_tab_helper.h View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/download/download_tab_helper.cc View 1 2 3 3 chunks +23 lines, -10 lines 0 comments Download
M chrome/common/render_messages.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M ppapi/c/private/ppb_pdf.h View 1 2 3 3 chunks +12 lines, -3 lines 0 comments Download
D webkit/glue/resources/pdf_button_fth.png View Binary file 0 comments Download
D webkit/glue/resources/pdf_button_fth_hover.png View Binary file 0 comments Download
D webkit/glue/resources/pdf_button_fth_pressed.png View Binary file 0 comments Download
A webkit/glue/resources/pdf_button_ftp.png View Binary file 0 comments Download
A webkit/glue/resources/pdf_button_ftp_hover.png View Binary file 0 comments Download
A webkit/glue/resources/pdf_button_ftp_pressed.png View Binary file 0 comments Download
M webkit/glue/resources/pdf_button_ftw.png View Binary file 0 comments Download
M webkit/glue/resources/pdf_button_ftw_hover.png View Binary file 0 comments Download
M webkit/glue/resources/pdf_button_ftw_pressed.png View Binary file 0 comments Download
A webkit/glue/resources/pdf_button_print.png View Binary file 0 comments Download
A webkit/glue/resources/pdf_button_print_hover.png View Binary file 0 comments Download
A webkit/glue/resources/pdf_button_print_pressed.png View Binary file 0 comments Download
A webkit/glue/resources/pdf_button_save.png View Binary file 0 comments Download
A webkit/glue/resources/pdf_button_save_hover.png View Binary file 0 comments Download
A webkit/glue/resources/pdf_button_save_pressed.png View Binary file 0 comments Download
M webkit/glue/resources/pdf_button_zoomin.png View Binary file 0 comments Download
M webkit/glue/resources/pdf_button_zoomin_hover.png View Binary file 0 comments Download
M webkit/glue/resources/pdf_button_zoomin_pressed.png View Binary file 0 comments Download
M webkit/glue/resources/pdf_button_zoomout.png View Binary file 0 comments Download
M webkit/glue/resources/pdf_button_zoomout_hover.png View Binary file 0 comments Download
M webkit/glue/resources/pdf_button_zoomout_pressed.png View Binary file 0 comments Download
M webkit/glue/webkit_resources.grd View 1 2 3 2 chunks +9 lines, -3 lines 0 comments Download
M webkit/plugins/ppapi/mock_plugin_delegate.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M webkit/plugins/ppapi/mock_plugin_delegate.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M webkit/plugins/ppapi/plugin_delegate.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M webkit/plugins/ppapi/ppb_pdf_impl.cc View 1 2 3 4 chunks +18 lines, -4 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
gene
9 years, 8 months ago (2011-04-15 17:44:06 UTC) #1
jam
http://codereview.chromium.org/6871020/diff/1/content/browser/tab_contents/tab_contents.cc File content/browser/tab_contents/tab_contents.cc (right): http://codereview.chromium.org/6871020/diff/1/content/browser/tab_contents/tab_contents.cc#newcode57 content/browser/tab_contents/tab_contents.cc:57: #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" TabContents doesn't know about TabContentsWrapper, so the ...
9 years, 8 months ago (2011-04-15 17:58:44 UTC) #2
gene
Done. Please take a look. Thanks for the tip. I like it more this way. ...
9 years, 8 months ago (2011-04-15 18:33:54 UTC) #3
jam
lgtm with the nit http://codereview.chromium.org/6871020/diff/2006/chrome/browser/ui/download/download_tab_helper.cc File chrome/browser/ui/download/download_tab_helper.cc (right): http://codereview.chromium.org/6871020/diff/2006/chrome/browser/ui/download/download_tab_helper.cc#newcode11 chrome/browser/ui/download/download_tab_helper.cc:11: #include "content/common/view_messages.h" you only need ...
9 years, 8 months ago (2011-04-15 18:53:22 UTC) #4
cevans
9 years, 8 months ago (2011-04-16 01:53:03 UTC) #5
Just wanted to raise a minor security issue (which we covered over chat).

What if the URL is evil.com/pdf.exe ?
We'll happily render a PDF from such an URL, as long as evil.com serves us a
PDF MIME type in the HTTP response.
The risk is that the attacker constructs a PDF that also parses as an EXE
(or some other combination, such as a PDF that also parses as a JAR or other
dangerous file type).

Since the PDF itself can initiate the "Save As" dialog, we should try and
avoid popping up a dialog that will save a dangerous file type with the
matching dangerous file extension. After all, the user things they are
simply saving a PDF.

The simplest solution is to make sure the saved PDF file actually ends in
.pdf


Cheers
Chris

On Fri, Apr 15, 2011 at 11:53 AM, <jam@chromium.org> wrote:

> lgtm with the nit
>
>
>
>
http://codereview.chromium.org/6871020/diff/2006/chrome/browser/ui/download/d...
> File chrome/browser/ui/download/download_tab_helper.cc (right):
>
>
>
http://codereview.chromium.org/6871020/diff/2006/chrome/browser/ui/download/d...
> chrome/browser/ui/download/download_tab_helper.cc:11: #include
> "content/common/view_messages.h"
> you only need one of these message headers
>
>
>
http://codereview.chromium.org/6871020/diff/2006/chrome/common/render_messages.h
> File chrome/common/render_messages.h (right):
>
>
>
http://codereview.chromium.org/6871020/diff/2006/chrome/common/render_message...
> chrome/common/render_messages.h:492:
>
> IPC_MESSAGE_ROUTED0(ViewHostMsg_SaveAs)
> I just realized that this needs to go into view_messages.h, since it's
> sent from code in content.
>
>
> http://codereview.chromium.org/6871020/
>

Powered by Google App Engine
This is Rietveld 408576698