| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/printing/printing_gtk_util.h" | |
| 6 | |
| 7 #include <gtk/gtk.h> | |
| 8 #include <gtk/gtkunixprint.h> | |
| 9 | |
| 10 #include "base/strings/string16.h" | |
| 11 #include "base/strings/utf_string_conversions.h" | |
| 12 #include "printing/print_settings.h" | |
| 13 #include "printing/printing_context_linux.h" | |
| 14 #include "printing/units.h" | |
| 15 | |
| 16 gfx::Size GetPdfPaperSizeDeviceUnitsGtk( | |
| 17 printing::PrintingContextLinux* context) { | |
| 18 GtkPageSetup* page_setup = gtk_page_setup_new(); | |
| 19 | |
| 20 gfx::SizeF paper_size( | |
| 21 gtk_page_setup_get_paper_width(page_setup, GTK_UNIT_INCH), | |
| 22 gtk_page_setup_get_paper_height(page_setup, GTK_UNIT_INCH)); | |
| 23 | |
| 24 g_object_unref(page_setup); | |
| 25 | |
| 26 const printing::PrintSettings& settings = context->settings(); | |
| 27 | |
| 28 return gfx::Size( | |
| 29 paper_size.width() * settings.device_units_per_inch(), | |
| 30 paper_size.height() * settings.device_units_per_inch()); | |
| 31 } | |
| OLD | NEW |