Commit c6e9b251 authored by vandebo@chromium.org's avatar vandebo@chromium.org

Fix regression in printing page settings CSS properties.

PrintWebViewHelper::GetPageSizeAndMarginsInPoints may update PrintMsg_Print_Params, so we must call UpdatePrintParams after that.

BUG=94294
TEST=Described in bug - print a page with page margin CSS.


Review URL: http://codereview.chromium.org/7794010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98772 0039d316-1c4b-4281-b951-d872f2087c98
parent 63833051
...@@ -985,7 +985,6 @@ void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters( ...@@ -985,7 +985,6 @@ void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters(
PrepareFrameAndViewForPrint* prepare, PrepareFrameAndViewForPrint* prepare,
PrintMsg_Print_Params* params) { PrintMsg_Print_Params* params) {
PageSizeMargins page_layout_in_points; PageSizeMargins page_layout_in_points;
prepare->UpdatePrintParams(*params);
PrintWebViewHelper::GetPageSizeAndMarginsInPoints(frame, 0, *params, PrintWebViewHelper::GetPageSizeAndMarginsInPoints(frame, 0, *params,
&page_layout_in_points); &page_layout_in_points);
int dpi = GetDPI(params); int dpi = GetDPI(params);
...@@ -1016,6 +1015,8 @@ void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters( ...@@ -1016,6 +1015,8 @@ void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters(
page_layout_in_points.margin_top, printing::kPointsPerInch, dpi)); page_layout_in_points.margin_top, printing::kPointsPerInch, dpi));
params->margin_left = static_cast<int>(ConvertUnitDouble( params->margin_left = static_cast<int>(ConvertUnitDouble(
page_layout_in_points.margin_left, printing::kPointsPerInch, dpi)); page_layout_in_points.margin_left, printing::kPointsPerInch, dpi));
prepare->UpdatePrintParams(*params);
} }
bool PrintWebViewHelper::InitPrintSettings(WebKit::WebFrame* frame, bool PrintWebViewHelper::InitPrintSettings(WebKit::WebFrame* frame,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment