diff options
author | aayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-25 21:12:02 +0000 |
---|---|---|
committer | aayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-25 21:12:02 +0000 |
commit | 9d0d357eb0baf6be8ed51c7de7bc132ab64c10d1 (patch) | |
tree | e4b09b31ac5b8013c1fdcf0071089fe667751514 /chrome/renderer/print_web_view_helper_linux.cc | |
parent | b0ff4e7c000ef7974e2b316388b4416d2ee59007 (diff) | |
download | chromium_src-9d0d357eb0baf6be8ed51c7de7bc132ab64c10d1.zip chromium_src-9d0d357eb0baf6be8ed51c7de7bc132ab64c10d1.tar.gz chromium_src-9d0d357eb0baf6be8ed51c7de7bc132ab64c10d1.tar.bz2 |
Added a struct to hold page sizes and margins.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7492031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93943 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper_linux.cc')
-rw-r--r-- | chrome/renderer/print_web_view_helper_linux.cc | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/chrome/renderer/print_web_view_helper_linux.cc b/chrome/renderer/print_web_view_helper_linux.cc index f293e21..3df18be 100644 --- a/chrome/renderer/print_web_view_helper_linux.cc +++ b/chrome/renderer/print_web_view_helper_linux.cc @@ -169,29 +169,21 @@ void PrintWebViewHelper::PrintPageInternal( const gfx::Size& canvas_size, WebFrame* frame, printing::Metafile* metafile) { - double content_width_in_points; - double content_height_in_points; - double margin_top_in_points; - double margin_right_in_points; - double margin_bottom_in_points; - double margin_left_in_points; - GetPageSizeAndMarginsInPoints(frame, - params.page_number, - params.params, - &content_width_in_points, - &content_height_in_points, - &margin_top_in_points, - &margin_right_in_points, - &margin_bottom_in_points, - &margin_left_in_points); + PageSizeMargins page_layout_in_points; + GetPageSizeAndMarginsInPoints(frame, params.page_number, params.params, + &page_layout_in_points); gfx::Size page_size( - content_width_in_points + margin_right_in_points + - margin_left_in_points, - content_height_in_points + margin_top_in_points + - margin_bottom_in_points); - gfx::Rect content_area(margin_left_in_points, margin_top_in_points, - content_width_in_points, content_height_in_points); + page_layout_in_points.content_width + + page_layout_in_points.margin_right + + page_layout_in_points.margin_left, + page_layout_in_points.content_height + + page_layout_in_points.margin_top + + page_layout_in_points.margin_bottom); + gfx::Rect content_area(page_layout_in_points.margin_left, + page_layout_in_points.margin_top, + page_layout_in_points.content_width, + page_layout_in_points.content_height); SkDevice* device = metafile->StartPageForVectorCanvas( params.page_number, page_size, content_area, 1.0f); |