diff options
author | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 19:25:17 +0000 |
---|---|---|
committer | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 19:25:17 +0000 |
commit | 5ad7617cd93b48a67395f532b8483b8ace445ca2 (patch) | |
tree | ef6ec65870ccdea737de7e0fdcf1d89e2d887511 /printing/print_settings_initializer_gtk.cc | |
parent | f83773f72845ed180a23dcbbfa9afbc3c295f758 (diff) | |
download | chromium_src-5ad7617cd93b48a67395f532b8483b8ace445ca2.zip chromium_src-5ad7617cd93b48a67395f532b8483b8ace445ca2.tar.gz chromium_src-5ad7617cd93b48a67395f532b8483b8ace445ca2.tar.bz2 |
Applying factory pattern (through NativeMetafileFactory class). It is used to retrieve different printing contexts (based on the platform and user preferences).
BUG=NONE
TEST=NONE
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=76553
Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=76555
Review URL: http://codereview.chromium.org/6544028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/print_settings_initializer_gtk.cc')
-rw-r--r-- | printing/print_settings_initializer_gtk.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/printing/print_settings_initializer_gtk.cc b/printing/print_settings_initializer_gtk.cc index 60ab530..8a62929 100644 --- a/printing/print_settings_initializer_gtk.cc +++ b/printing/print_settings_initializer_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,7 @@ #include "base/string_piece.h" #include "base/utf_string_conversions.h" -#include "printing/native_metafile.h" +#include "printing/pdf_ps_metafile_cairo.h" #include "printing/print_settings.h" #include "printing/units.h" @@ -58,19 +58,19 @@ void PrintSettingsInitializerGtk::InitPrintSettings( double page_width_in_pixel = 8.5 * dpi; double page_height_in_pixel = 11.0 * dpi; physical_size_device_units.SetSize( - static_cast<int>(page_width_in_pixel), - static_cast<int>(page_height_in_pixel)); + static_cast<int>(page_width_in_pixel), + static_cast<int>(page_height_in_pixel)); printable_area_device_units.SetRect( - static_cast<int>( - NativeMetafile::kLeftMarginInInch * dpi), - static_cast<int>( - NativeMetafile::kTopMarginInInch * dpi), - page_width_in_pixel - - (NativeMetafile::kLeftMarginInInch + - NativeMetafile::kRightMarginInInch) * dpi, - page_height_in_pixel - - (NativeMetafile::kTopMarginInInch + - NativeMetafile::kBottomMarginInInch) * dpi); + static_cast<int>( + PdfPsMetafile::kLeftMarginInInch * dpi), + static_cast<int>( + PdfPsMetafile::kTopMarginInInch * dpi), + page_width_in_pixel - + (PdfPsMetafile::kLeftMarginInInch + + PdfPsMetafile::kRightMarginInInch) * dpi, + page_height_in_pixel - + (PdfPsMetafile::kTopMarginInInch + + PdfPsMetafile::kBottomMarginInInch) * dpi); } print_settings->set_dpi(dpi); |