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

Unified Diff: printing/print_settings_initializer_gtk.cc

Issue 47823002: De-duplicate job_settings parsing code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Noam's comments Created 7 years, 2 months 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_initializer_gtk.h ('k') | printing/print_settings_initializer_mac.h » ('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 c492f5a7ea6ba675f54d83ebf1e8a6c679d4206e..793fdb868a34ab890b54064c20795df5cc3fc203 100644
--- a/printing/print_settings_initializer_gtk.cc
+++ b/printing/print_settings_initializer_gtk.cc
@@ -18,8 +18,6 @@ namespace printing {
void PrintSettingsInitializerGtk::InitPrintSettings(
GtkPrintSettings* settings,
GtkPageSetup* page_setup,
- const PageRanges& new_ranges,
- bool print_selection_only,
PrintSettings* print_settings) {
DCHECK(settings);
DCHECK(page_setup);
@@ -28,8 +26,6 @@ void PrintSettingsInitializerGtk::InitPrintSettings(
base::string16 name(base::UTF8ToUTF16(static_cast<const char*>(
gtk_print_settings_get_printer(settings))));
print_settings->set_device_name(name);
- print_settings->ranges = new_ranges;
- print_settings->selection_only = print_selection_only;
gfx::Size physical_size_device_units;
gfx::Rect printable_area_device_units;
@@ -60,9 +56,6 @@ void PrintSettingsInitializerGtk::InitPrintSettings(
}
print_settings->set_dpi(dpi);
- print_settings->SetPrinterPrintableArea(physical_size_device_units,
- printable_area_device_units,
- dpi);
// Note: With the normal GTK print dialog, when the user selects the landscape
// orientation, all that does is change the paper size. Which seems to be
@@ -72,7 +65,12 @@ void PrintSettingsInitializerGtk::InitPrintSettings(
// Thus this is only useful in print preview mode, where we manually set the
// orientation and change the paper size ourselves.
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);
+
+ print_settings->SetPrinterPrintableArea(physical_size_device_units,
+ printable_area_device_units,
+ dpi, true);
}
const double PrintSettingsInitializerGtk::kTopMarginInInch = 0.25;
« no previous file with comments | « printing/print_settings_initializer_gtk.h ('k') | printing/print_settings_initializer_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698