Index: printing/printed_document_win.cc |
diff --git a/printing/printed_document_win.cc b/printing/printed_document_win.cc |
index e80ac78a749e6576aef22ee12fa726e08ed514b5..ac5008c98a7698cbe116de9a3f3e977b1cf6fe37 100644 |
--- a/printing/printed_document_win.cc |
+++ b/printing/printed_document_win.cc |
@@ -51,17 +51,8 @@ void PrintedDocument::RenderPrintedPage( |
const printing::PageSetup& page_setup( |
immutable_.settings_.page_setup_device_units()); |
- gfx::Rect content_area(page.page_content_rect()); |
- const gfx::Size& physical_size = page_setup.physical_size(); |
- // http://dev.w3.org/csswg/css3-page/#positioning-page-box |
- if (physical_size.width() > page.page_size().width()) { |
- int diff = physical_size.width() - page.page_size().width(); |
- content_area.set_x(content_area.x() + diff / 2); |
- } |
- if (physical_size.height() > page.page_size().height()) { |
- int diff = physical_size.height() - page.page_size().height(); |
- content_area.set_y(content_area.y() + diff / 2); |
- } |
+ gfx::Rect content_area; |
+ page.GetCenteredPageContentRect(page_setup.physical_size(), &content_area); |
// Save the state to make sure the context this function call does not modify |
// the device context. |