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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 6374004: Clean up windows printing workflow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 'Added comments.' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/renderer/print_web_view_helper_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper.cc
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index 4412a514d663067f1a07c1b3c7997a536d3fa8b5..58af5f6314dd3b04c8c49cabcef54df7c85b1fe5 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -401,13 +401,16 @@ void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters(
static_cast<int>(ConvertUnitDouble(content_height_in_points,
printing::kPointsPerInch, dpi)));
+ double page_width_in_points = content_width_in_points +
+ margin_left_in_points + margin_right_in_points;
+ double page_height_in_points = content_height_in_points +
+ margin_top_in_points + margin_bottom_in_points;
+
params->page_size = gfx::Size(
- static_cast<int>(ConvertUnitDouble(content_width_in_points +
- margin_left_in_points + margin_right_in_points,
- printing::kPointsPerInch, dpi)),
- static_cast<int>(ConvertUnitDouble(content_height_in_points +
- margin_top_in_points + margin_bottom_in_points,
- printing::kPointsPerInch, dpi)));
+ static_cast<int>(ConvertUnitDouble(
+ page_width_in_points, printing::kPointsPerInch, dpi)),
+ static_cast<int>(ConvertUnitDouble(
+ page_height_in_points, printing::kPointsPerInch, dpi)));
params->margin_top = static_cast<int>(ConvertUnitDouble(
margin_top_in_points, printing::kPointsPerInch, dpi));
« no previous file with comments | « no previous file | chrome/renderer/print_web_view_helper_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698