| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "printing/print_settings_initializer_gtk.h" | 5 #include "printing/print_settings_initializer_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <gtk/gtkprinter.h> | 8 #include <gtk/gtkprinter.h> |
| 9 | 9 |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "printing/print_job_constants.h" |
| 12 #include "printing/print_settings.h" | 13 #include "printing/print_settings.h" |
| 13 #include "printing/units.h" | 14 #include "printing/units.h" |
| 14 | 15 |
| 15 namespace printing { | 16 namespace printing { |
| 16 | 17 |
| 17 // static | 18 // static |
| 18 void PrintSettingsInitializerGtk::InitPrintSettings( | 19 void PrintSettingsInitializerGtk::InitPrintSettings( |
| 19 GtkPrintSettings* settings, | 20 GtkPrintSettings* settings, |
| 20 GtkPageSetup* page_setup, | 21 GtkPageSetup* page_setup, |
| 21 const PageRanges& new_ranges, | 22 const PageRanges& new_ranges, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 69 |
| 69 // Note: With the normal GTK print dialog, when the user selects the landscape | 70 // Note: With the normal GTK print dialog, when the user selects the landscape |
| 70 // orientation, all that does is change the paper size. Which seems to be | 71 // orientation, all that does is change the paper size. Which seems to be |
| 71 // enough to render the right output and send it to the printer. | 72 // enough to render the right output and send it to the printer. |
| 72 // The orientation value stays as portrait and does not actually affect | 73 // The orientation value stays as portrait and does not actually affect |
| 73 // printing. | 74 // printing. |
| 74 // Thus this is only useful in print preview mode, where we manually set the | 75 // Thus this is only useful in print preview mode, where we manually set the |
| 75 // orientation and change the paper size ourselves. | 76 // orientation and change the paper size ourselves. |
| 76 GtkPageOrientation orientation = gtk_print_settings_get_orientation(settings); | 77 GtkPageOrientation orientation = gtk_print_settings_get_orientation(settings); |
| 77 print_settings->SetOrientation(orientation == GTK_PAGE_ORIENTATION_LANDSCAPE); | 78 print_settings->SetOrientation(orientation == GTK_PAGE_ORIENTATION_LANDSCAPE); |
| 79 |
| 80 print_settings->header_footer = gtk_print_settings_get_bool(settings, |
| 81 printing::kSettingHeaderFooter); |
| 78 } | 82 } |
| 79 | 83 |
| 80 const double PrintSettingsInitializerGtk::kTopMarginInInch = 0.25; | 84 const double PrintSettingsInitializerGtk::kTopMarginInInch = 0.25; |
| 81 const double PrintSettingsInitializerGtk::kBottomMarginInInch = 0.56; | 85 const double PrintSettingsInitializerGtk::kBottomMarginInInch = 0.56; |
| 82 const double PrintSettingsInitializerGtk::kLeftMarginInInch = 0.25; | 86 const double PrintSettingsInitializerGtk::kLeftMarginInInch = 0.25; |
| 83 const double PrintSettingsInitializerGtk::kRightMarginInInch = 0.25; | 87 const double PrintSettingsInitializerGtk::kRightMarginInInch = 0.25; |
| 84 | 88 |
| 85 } // namespace printing | 89 } // namespace printing |
| OLD | NEW |