summaryrefslogtreecommitdiffstats
path: root/printing/print_settings_initializer_gtk.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 19:54:10 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 19:54:10 +0000
commit2896dccc7a66c857f53f297d9ae9790b242a0e92 (patch)
treec99db90b743a12416d329403c9b6752c624b780c /printing/print_settings_initializer_gtk.cc
parenta01d93551393e886430385e641b2bd80ef3ba913 (diff)
downloadchromium_src-2896dccc7a66c857f53f297d9ae9790b242a0e92.zip
chromium_src-2896dccc7a66c857f53f297d9ae9790b242a0e92.tar.gz
chromium_src-2896dccc7a66c857f53f297d9ae9790b242a0e92.tar.bz2
Printing: Move the default margin constants out of PdfPsMetafile.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6694005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78266 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/print_settings_initializer_gtk.cc')
-rw-r--r--printing/print_settings_initializer_gtk.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/printing/print_settings_initializer_gtk.cc b/printing/print_settings_initializer_gtk.cc
index 8a62929..833db52 100644
--- a/printing/print_settings_initializer_gtk.cc
+++ b/printing/print_settings_initializer_gtk.cc
@@ -51,9 +51,7 @@ void PrintSettingsInitializerGtk::InitPrintSettings(
gtk_page_setup_get_page_width(page_setup, GTK_UNIT_INCH) * dpi,
gtk_page_setup_get_page_height(page_setup, GTK_UNIT_INCH) * dpi);
} else {
- // Use dummy values if we cannot get valid values.
- // TODO(jhawkins) Remove this hack when the Linux printing refactoring
- // finishes.
+ // Use default values if we cannot get valid values from the print dialog.
dpi = kPixelsPerInch;
double page_width_in_pixel = 8.5 * dpi;
double page_height_in_pixel = 11.0 * dpi;
@@ -61,16 +59,10 @@ void PrintSettingsInitializerGtk::InitPrintSettings(
static_cast<int>(page_width_in_pixel),
static_cast<int>(page_height_in_pixel));
printable_area_device_units.SetRect(
- 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);
+ static_cast<int>(kLeftMarginInInch * dpi),
+ static_cast<int>(kTopMarginInInch * dpi),
+ page_width_in_pixel - (kLeftMarginInInch + kRightMarginInInch) * dpi,
+ page_height_in_pixel - (kTopMarginInInch + kBottomMarginInInch) * dpi);
}
print_settings->set_dpi(dpi);
@@ -79,4 +71,9 @@ void PrintSettingsInitializerGtk::InitPrintSettings(
dpi);
}
+const double PrintSettingsInitializerGtk::kTopMarginInInch = 0.25;
+const double PrintSettingsInitializerGtk::kBottomMarginInInch = 0.56;
+const double PrintSettingsInitializerGtk::kLeftMarginInInch = 0.25;
+const double PrintSettingsInitializerGtk::kRightMarginInInch = 0.25;
+
} // namespace printing