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

Issue 6261025: Refactor win printing workflow to support print preview. (Closed)

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

Description

Refactor win printing workflow to support print preview. Made code changes to create a single metafile for the entire printing document. Implemented the following function: 1. CreatePreviewDocument(): Create a single metafile and render all the pages(entire printing document) into the same metafile. Note: Although the structure of PrintPage() function looks similar to CreatePreviewDocument(), merging of these functions is difficult for the following reasons: 1. As of now, we are using EMF metafile to create a preview document. In future we are going to use Skia->PDF metafile. So construction and destruction of the metafile will be different. 2. The message for preview workflow(ViewHostMsg_PagesReadyForPreview) is different from normal printing workflow(ViewHostMsg_DidPrintPage). 3. The param struct which is sent along with the message for preview workflow is different from printing workflow. 4. Finally, the semantics of PrintPage() function is to print a page per metafile which is completely different from the semantics of CreatePreviewDocument() function. Once Skia->Pdf work is completed, Modify CreatePreviewDocument() function to use this PDF metafile. BUG=64121 TEST=printing works after code changes. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72804

Patch Set 1 #

Total comments: 12

Patch Set 2 : '' #

Patch Set 3 : Fixed style issues. #

Total comments: 2

Patch Set 4 : Rename variable #

Total comments: 4

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -26 lines) Patch
M chrome/renderer/print_web_view_helper.h View 1 2 3 4 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/renderer/print_web_view_helper.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/renderer/print_web_view_helper_win.cc View 1 2 3 3 chunks +84 lines, -21 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
kmadhusu
9 years, 11 months ago (2011-01-26 02:10:06 UTC) #1
Lei Zhang
http://codereview.chromium.org/6261025/diff/1/chrome/renderer/print_web_view_helper_win.cc File chrome/renderer/print_web_view_helper_win.cc (right): http://codereview.chromium.org/6261025/diff/1/chrome/renderer/print_web_view_helper_win.cc#newcode67 chrome/renderer/print_web_view_helper_win.cc:67: const ViewMsg_Print_Params& params, WebFrame* frame, int page_number) { Have ...
9 years, 11 months ago (2011-01-26 08:06:51 UTC) #2
kmadhusu
Made code changes as per comments. Please review. Thanks. http://codereview.chromium.org/6261025/diff/1/chrome/renderer/print_web_view_helper_win.cc File chrome/renderer/print_web_view_helper_win.cc (right): http://codereview.chromium.org/6261025/diff/1/chrome/renderer/print_web_view_helper_win.cc#newcode67 chrome/renderer/print_web_view_helper_win.cc:67: ...
9 years, 11 months ago (2011-01-26 18:08:28 UTC) #3
Lei Zhang
LGTM with nit below. http://codereview.chromium.org/6261025/diff/7001/chrome/renderer/print_web_view_helper_win.cc File chrome/renderer/print_web_view_helper_win.cc (right): http://codereview.chromium.org/6261025/diff/7001/chrome/renderer/print_web_view_helper_win.cc#newcode122 chrome/renderer/print_web_view_helper_win.cc:122: ViewMsg_Print_Params printParams = params.params; Now ...
9 years, 11 months ago (2011-01-26 19:45:26 UTC) #4
kmadhusu
http://codereview.chromium.org/6261025/diff/7001/chrome/renderer/print_web_view_helper_win.cc File chrome/renderer/print_web_view_helper_win.cc (right): http://codereview.chromium.org/6261025/diff/7001/chrome/renderer/print_web_view_helper_win.cc#newcode122 chrome/renderer/print_web_view_helper_win.cc:122: ViewMsg_Print_Params printParams = params.params; On 2011/01/26 19:45:26, Lei Zhang ...
9 years, 11 months ago (2011-01-26 20:00:51 UTC) #5
vandebo (ex-Chrome)
LGTM Looking at the larger context just a bit, unless there's a good reason to ...
9 years, 11 months ago (2011-01-26 23:38:54 UTC) #6
kmadhusu
9 years, 11 months ago (2011-01-27 00:13:54 UTC) #7
Thanks for the comments.

http://codereview.chromium.org/6261025/diff/13001/chrome/renderer/print_web_v...
File chrome/renderer/print_web_view_helper.cc (right):

http://codereview.chromium.org/6261025/diff/13001/chrome/renderer/print_web_v...
chrome/renderer/print_web_view_helper.cc:518: // TODO(kmadhusu): Implement this
function for windows & linux.
On 2011/01/26 23:38:54, vandebo wrote:
> nit: Update your TODO

Done.

http://codereview.chromium.org/6261025/diff/13001/chrome/renderer/print_web_v...
File chrome/renderer/print_web_view_helper_win.cc (right):

http://codereview.chromium.org/6261025/diff/13001/chrome/renderer/print_web_v...
chrome/renderer/print_web_view_helper_win.cc:118: void
PrintWebViewHelper::CreatePreviewDocument(
On 2011/01/26 23:38:54, vandebo wrote:
> nit: It'd be good to document the parameters to this method in the header.
> Specifically because most methods tend to take one params struct so pointing
out
> what they are in this case would be useful.

Done.

Powered by Google App Engine
This is Rietveld 408576698