| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/libgtk2ui/printing_gtk2_util.h" | 5 #include "chrome/browser/ui/libgtkui/printing_gtk2_util.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <gtk/gtkunixprint.h> | 8 #include <gtk/gtkunixprint.h> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "printing/print_settings.h" | 12 #include "printing/print_settings.h" |
| 13 #include "printing/printing_context_linux.h" | 13 #include "printing/printing_context_linux.h" |
| 14 #include "printing/units.h" | 14 #include "printing/units.h" |
| 15 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // Thus this is only useful in print preview mode, where we manually set the | 90 // Thus this is only useful in print preview mode, where we manually set the |
| 91 // orientation and change the paper size ourselves. | 91 // orientation and change the paper size ourselves. |
| 92 GtkPageOrientation orientation = gtk_print_settings_get_orientation(settings); | 92 GtkPageOrientation orientation = gtk_print_settings_get_orientation(settings); |
| 93 // Set before SetPrinterPrintableArea to make it flip area if necessary. | 93 // Set before SetPrinterPrintableArea to make it flip area if necessary. |
| 94 print_settings->SetOrientation(orientation == GTK_PAGE_ORIENTATION_LANDSCAPE); | 94 print_settings->SetOrientation(orientation == GTK_PAGE_ORIENTATION_LANDSCAPE); |
| 95 DCHECK_EQ(print_settings->device_units_per_inch(), dpi); | 95 DCHECK_EQ(print_settings->device_units_per_inch(), dpi); |
| 96 print_settings->SetPrinterPrintableArea(physical_size_device_units, | 96 print_settings->SetPrinterPrintableArea(physical_size_device_units, |
| 97 printable_area_device_units, | 97 printable_area_device_units, |
| 98 true); | 98 true); |
| 99 } | 99 } |
| OLD | NEW |