diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 23:11:25 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 23:11:25 +0000 |
commit | fd25b3a119eb82d2bec5b685f59435754a3c04b3 (patch) | |
tree | 5fadf99830274c3882348aabac267f8e87af0386 | |
parent | 4d65983f4665c2dab308957c10c1c051b5e57509 (diff) | |
download | chromium_src-fd25b3a119eb82d2bec5b685f59435754a3c04b3.zip chromium_src-fd25b3a119eb82d2bec5b685f59435754a3c04b3.tar.gz chromium_src-fd25b3a119eb82d2bec5b685f59435754a3c04b3.tar.bz2 |
CalculatePrintParamsForCss must be called after printBegin.
Restoring logic lost with http://src.chromium.org/viewvc/chrome?view=rev&revision=178439
BUG=196282
Review URL: https://chromiumcodereview.appspot.com/12962004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189452 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/printing/print_web_view_helper.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc index f7526be..6abcfb3 100644 --- a/chrome/renderer/printing/print_web_view_helper.cc +++ b/chrome/renderer/printing/print_web_view_helper.cc @@ -565,11 +565,13 @@ PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint( bool fit_to_page = ignore_css_margins && print_params.print_scaling_option == WebKit::WebPrintScalingOptionFitToPrintableArea; + ComputeWebKitPrintParamsInDesiredDpi(params, &web_print_params_); + frame_->printBegin(web_print_params_, node_to_print_, NULL); print_params = CalculatePrintParamsForCss(frame_, 0, print_params, ignore_css_margins, fit_to_page, NULL); + frame_->printEnd(); } - ComputeWebKitPrintParamsInDesiredDpi(print_params, &web_print_params_); } @@ -662,6 +664,7 @@ void PrepareFrameAndViewForPrint::CallOnReady() { } gfx::Size PrepareFrameAndViewForPrint::GetPrintCanvasSize() const { + DCHECK(is_printing_started_); return gfx::Size(web_print_params_.printContentArea.width, web_print_params_.printContentArea.height); } |