Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: printing/print_settings_initializer_gtk.cc

Issue 46623002: Move settings setup for PDF and cloud print into single location in PrintingContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/print_settings.cc ('k') | printing/print_settings_initializer_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/print_settings_initializer_gtk.cc
diff --git a/printing/print_settings_initializer_gtk.cc b/printing/print_settings_initializer_gtk.cc
index 793fdb868a34ab890b54064c20795df5cc3fc203..53cb9bbee380e3440a0f60e2efd80216a9c5b257 100644
--- a/printing/print_settings_initializer_gtk.cc
+++ b/printing/print_settings_initializer_gtk.cc
@@ -43,8 +43,8 @@ void PrintSettingsInitializerGtk::InitPrintSettings(
} else {
// 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;
+ double page_width_in_pixel = kLetterWidthInch * dpi;
+ double page_height_in_pixel = kLetterHeightInch * dpi;
physical_size_device_units.SetSize(
static_cast<int>(page_width_in_pixel),
static_cast<int>(page_height_in_pixel));
@@ -67,10 +67,10 @@ void PrintSettingsInitializerGtk::InitPrintSettings(
GtkPageOrientation orientation = gtk_print_settings_get_orientation(settings);
// Set before SetPrinterPrintableArea to make it flip area if necessary.
print_settings->SetOrientation(orientation == GTK_PAGE_ORIENTATION_LANDSCAPE);
-
+ DCHECK_EQ(print_settings->device_units_per_inch(), dpi);
print_settings->SetPrinterPrintableArea(physical_size_device_units,
printable_area_device_units,
- dpi, true);
+ true);
}
const double PrintSettingsInitializerGtk::kTopMarginInInch = 0.25;
« no previous file with comments | « printing/print_settings.cc ('k') | printing/print_settings_initializer_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698