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

Issue 9705084: Block printing from blocked popup. (Closed)

Created:
8 years, 9 months ago by Albert Bodenhamer
Modified:
8 years, 9 months ago
Reviewers:
Lei Zhang
CC:
chromium-reviews, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Block printing from blocked popup. Adds a check in the window.print call to make window.print fail if called from a blocked popup. Also adds handling to print_preview_tab_controller.cc to mark preview as done if the creation of the print preview ui fails. BUG=117955 TEST=Open test page attached to bug 117955. Allow the blocked popup. Ctrl-P should work normally.

Patch Set 1 #

Patch Set 2 : Remove unneeded forward include #

Patch Set 3 : Fix copy-paste error #

Patch Set 4 : Test fixes #

Patch Set 5 : More test fixes #

Total comments: 11

Patch Set 6 : Feedback #

Patch Set 7 : Whitespace #

Patch Set 8 : Fix init order #

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -3 lines) Patch
M chrome/browser/printing/print_preview_tab_controller.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/printing/print_view_manager.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/printing/print_view_manager.cc View 3 chunks +9 lines, -0 lines 0 comments Download
M chrome/common/print_messages.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/renderer/chrome_mock_render_thread.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/chrome_mock_render_thread.cc View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/renderer/mock_printer.h View 1 2 3 4 5 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/renderer/mock_printer.cc View 1 2 3 4 5 6 7 3 chunks +9 lines, -0 lines 0 comments Download
M chrome/renderer/print_web_view_helper.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/renderer/print_web_view_helper.cc View 2 chunks +13 lines, -1 line 0 comments Download
M chrome/renderer/print_web_view_helper_browsertest.cc View 1 2 3 4 5 6 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Albert Bodenhamer
8 years, 9 months ago (2012-03-16 16:28:36 UTC) #1
Albert Bodenhamer
Actually, hold off on reviewing this. There's a test that I missed updating and problems ...
8 years, 9 months ago (2012-03-16 17:33:26 UTC) #2
Albert Bodenhamer
Fixed. Please take a look when you get a chance.
8 years, 9 months ago (2012-03-19 16:44:30 UTC) #3
Lei Zhang
http://codereview.chromium.org/9705084/diff/11001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/9705084/diff/11001/chrome/browser/printing/print_preview_tab_controller.cc#newcode218 chrome/browser/printing/print_preview_tab_controller.cc:218: if (tab_controller->GetOrCreatePreviewTab(tab) == NULL) nit: It's easier to just ...
8 years, 9 months ago (2012-03-19 20:19:32 UTC) #4
Albert Bodenhamer
http://codereview.chromium.org/9705084/diff/11001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/9705084/diff/11001/chrome/browser/printing/print_preview_tab_controller.cc#newcode218 chrome/browser/printing/print_preview_tab_controller.cc:218: if (tab_controller->GetOrCreatePreviewTab(tab) == NULL) On 2012/03/19 20:19:32, Lei Zhang ...
8 years, 9 months ago (2012-03-19 23:16:17 UTC) #5
Lei Zhang
http://codereview.chromium.org/9705084/diff/11001/chrome/renderer/print_web_view_helper.cc File chrome/renderer/print_web_view_helper.cc (right): http://codereview.chromium.org/9705084/diff/11001/chrome/renderer/print_web_view_helper.cc#newcode671 chrome/renderer/print_web_view_helper.cc:671: msg->EnableMessagePumping(); On 2012/03/19 23:16:17, Albert Bodenhamer wrote: > On ...
8 years, 9 months ago (2012-03-20 20:34:02 UTC) #6
Albert Bodenhamer
On Tue, Mar 20, 2012 at 1:34 PM, <thestig@chromium.org> wrote: > > http://codereview.chromium.**org/9705084/diff/11001/chrome/** > renderer/print_web_view_**helper.cc<http://codereview.chromium.org/9705084/diff/11001/chrome/renderer/print_web_view_helper.cc> ...
8 years, 9 months ago (2012-03-20 20:52:18 UTC) #7
Albert Bodenhamer
On Tue, Mar 20, 2012 at 1:51 PM, Albert Bodenhamer <abodenha@chromium.org>wrote: > On Tue, Mar ...
8 years, 9 months ago (2012-03-20 22:02:44 UTC) #8
Lei Zhang
8 years, 9 months ago (2012-03-20 22:17:05 UTC) #9
On 2012/03/20 22:02:44, Albert Bodenhamer wrote:
> Something was bugging me about this.  It just hit me what it is.  I like
> that BlockedContentTabHelper is driving the blocked state, but I DON'T like
> that it needs to talk directly to PrintViewManager.
> 
> What do you think about adding a new notification?  We could create
> NOTIFICATION_CONTENT_BLOCKED with the source set to the TabContentsWrapper
> of the blocked content and then observe the notification in
> PrintViewManager.
> 
> Thoughts?

That's fine by me. Just pretend my CL was a PoC.

Powered by Google App Engine
This is Rietveld 408576698