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

Issue 7822014: Fix the print preview regression bug caused by r98926. (Closed)

Created:
9 years, 3 months ago by kmadhusu
Modified:
9 years, 3 months ago
CC:
chromium-reviews, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Fix the print preview regression bug caused by r98926. If we are previewing a PDF file, always invoke "PrepareFrameAndPrint" FinishPrinting() before calling metafile FinishDocument() function. If we are previewing a normal html page, we can invoke FinishDocument() as soon as the print ready document is ready and then we can call FinishPrinting() after rendering all the draft pages. BUG=94998 TEST=Preview PDFs results in valid preview data. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=99344

Patch Set 1 #

Patch Set 2 : Refactored the code as per comments. #

Total comments: 7

Patch Set 3 : Fixed a minor issue in print_preview.js #

Patch Set 4 : Fixed a typo #

Total comments: 2

Patch Set 5 : Rebased with trunk code. #

Patch Set 6 : Fix js code comments. #

Patch Set 7 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -7 lines) Patch
M chrome/browser/resources/print_preview/print_preview.js View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/renderer/print_web_view_helper.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/print_web_view_helper.cc View 1 2 3 4 4 chunks +24 lines, -7 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
kmadhusu
9 years, 3 months ago (2011-09-01 02:58:20 UTC) #1
Lei Zhang
LGTM Are these rules about the Finish*() ordering documented anywhere? It seems this is fragile ...
9 years, 3 months ago (2011-09-01 05:26:07 UTC) #2
kmadhusu
vandebo: As we discussed I have refactored the code to make it less fragile. thestig: ...
9 years, 3 months ago (2011-09-01 18:40:20 UTC) #3
vandebo (ex-Chrome)
http://codereview.chromium.org/7822014/diff/4001/chrome/renderer/print_web_view_helper.cc File chrome/renderer/print_web_view_helper.cc (right): http://codereview.chromium.org/7822014/diff/4001/chrome/renderer/print_web_view_helper.cc#newcode714 chrome/renderer/print_web_view_helper.cc:714: // AllPagesRendered() will be called only once i.e., after ...
9 years, 3 months ago (2011-09-01 18:53:56 UTC) #4
kmadhusu
http://codereview.chromium.org/7822014/diff/4001/chrome/renderer/print_web_view_helper.cc File chrome/renderer/print_web_view_helper.cc (right): http://codereview.chromium.org/7822014/diff/4001/chrome/renderer/print_web_view_helper.cc#newcode714 chrome/renderer/print_web_view_helper.cc:714: // AllPagesRendered() will be called only once i.e., after ...
9 years, 3 months ago (2011-09-01 20:07:14 UTC) #5
vandebo (ex-Chrome)
C++ LGTM
9 years, 3 months ago (2011-09-01 20:25:03 UTC) #6
kmadhusu
dpapad: Can you please review js code?
9 years, 3 months ago (2011-09-01 20:25:18 UTC) #7
dpapad
http://codereview.chromium.org/7822014/diff/4004/chrome/browser/resources/print_preview/print_preview.js File chrome/browser/resources/print_preview/print_preview.js (right): http://codereview.chromium.org/7822014/diff/4004/chrome/browser/resources/print_preview/print_preview.js#newcode924 chrome/browser/resources/print_preview/print_preview.js:924: if (pageSettings.requestPrintPreviewIfNeeded()) Repeating our in person discussion, it seems ...
9 years, 3 months ago (2011-09-01 21:20:53 UTC) #8
kmadhusu
http://codereview.chromium.org/7822014/diff/4004/chrome/browser/resources/print_preview/print_preview.js File chrome/browser/resources/print_preview/print_preview.js (right): http://codereview.chromium.org/7822014/diff/4004/chrome/browser/resources/print_preview/print_preview.js#newcode924 chrome/browser/resources/print_preview/print_preview.js:924: if (pageSettings.requestPrintPreviewIfNeeded()) On 2011/09/01 21:20:53, dpapad wrote: > Repeating ...
9 years, 3 months ago (2011-09-01 21:38:34 UTC) #9
dpapad
LGTM for js.
9 years, 3 months ago (2011-09-01 21:45:05 UTC) #10
commit-bot: I haz the power
9 years, 3 months ago (2011-09-02 09:04:41 UTC) #11
Change committed as 99344

Powered by Google App Engine
This is Rietveld 408576698