diff options
author | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 17:52:23 +0000 |
---|---|---|
committer | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 17:52:23 +0000 |
commit | edc531f9ec270823787167f70c4c8c1ad45de146 (patch) | |
tree | 32bd3b45f3a93a4f060c82eda8d9c6a669bbd0ee /chrome/renderer/print_web_view_helper_win.cc | |
parent | 3e7b5d650e797a288c51e6a74d4595dc0e555d0b (diff) | |
download | chromium_src-edc531f9ec270823787167f70c4c8c1ad45de146.zip chromium_src-edc531f9ec270823787167f70c4c8c1ad45de146.tar.gz chromium_src-edc531f9ec270823787167f70c4c8c1ad45de146.tar.bz2 |
Unifying StartPage across all platforms
Since there is already a getter method for retrieving the context, there is no reason for StartPage to return it. Also the parameter list can be uniform across all platforms. Some arguments are unused in order to achieve this.
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/6667069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78717 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper_win.cc')
-rw-r--r-- | chrome/renderer/print_web_view_helper_win.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc index 72e3399..33ff59b 100644 --- a/chrome/renderer/print_web_view_helper_win.cc +++ b/chrome/renderer/print_web_view_helper_win.cc @@ -15,6 +15,9 @@ #include "skia/ext/vector_platform_device.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "ui/gfx/gdi_util.h" +#include "ui/gfx/point.h" +#include "ui/gfx/rect.h" +#include "ui/gfx/size.h" using printing::ConvertUnitDouble; using printing::kPointsPerInch; @@ -199,9 +202,13 @@ void PrintWebViewHelper::RenderPage( double content_width_in_points; double content_height_in_points; + double margin_top_in_points; + double margin_left_in_points; GetPageSizeAndMarginsInPoints(frame, page_number, params, - &content_width_in_points, &content_height_in_points, NULL, NULL, NULL, - NULL); + &content_width_in_points, + &content_height_in_points, + &margin_top_in_points, NULL, NULL, + &margin_left_in_points); // Since WebKit extends the page width depending on the magical scale factor // we make sure the canvas covers the worst case scenario (x2.0 currently). @@ -209,7 +216,11 @@ void PrintWebViewHelper::RenderPage( int width = static_cast<int>(content_width_in_points * params.max_shrink); int height = static_cast<int>(content_height_in_points * params.max_shrink); - bool result = (*metafile)->StartPage(); + bool result = (*metafile)->StartPage( + gfx::Size(width, height), + gfx::Point(static_cast<int>(margin_top_in_points), + static_cast<int>(margin_left_in_points)), + *scale_factor); DCHECK(result); #if 0 |