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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 2859040: Implement limited paged media support for win. (Closed)
Patch Set: the comment fix Created 10 years, 6 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 | « chrome/common/render_messages.h ('k') | 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 fb0ece77ff9b9fe28f27d34a2d44b39b314daddc..b0ae1d2270f15c1010bc9f2d6ab21d844e34c986 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -22,6 +22,7 @@
using printing::ConvertPixelsToPoint;
using printing::ConvertPixelsToPointDouble;
using printing::ConvertUnit;
+using printing::ConvertUnitDouble;
using WebKit::WebConsoleMessage;
using WebKit::WebFrame;
using WebKit::WebRect;
@@ -437,15 +438,21 @@ void PrintWebViewHelper::GetPageSizeAndMarginsInPoints(
void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters(
WebFrame* frame, ViewMsg_Print_Params* params) {
-#if defined(OS_MACOSX)
double content_width_in_points;
double content_height_in_points;
PrintWebViewHelper::GetPageSizeAndMarginsInPoints(frame, 0, *params,
&content_width_in_points,
&content_height_in_points,
NULL, NULL, NULL, NULL);
+#if defined(OS_MACOSX)
params->printable_size = gfx::Size(
static_cast<int>(content_width_in_points),
static_cast<int>(content_height_in_points));
+#else
+ params->printable_size = gfx::Size(
+ static_cast<int>(ConvertUnitDouble(
+ content_width_in_points, printing::kPointsPerInch, params->dpi)),
+ static_cast<int>(ConvertUnitDouble(
+ content_height_in_points, printing::kPointsPerInch, params->dpi)));
#endif
}
« no previous file with comments | « chrome/common/render_messages.h ('k') | chrome/renderer/print_web_view_helper_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698