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

Side by Side Diff: printing/print_settings_initializer_gtk.cc

Issue 4732002: Fix DCHECK failure in page_setup.cc on Linux. (Closed)
Patch Set: Created 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // TODO(jhawkins) Remove this hack when the Linux printing refactoring 55 // TODO(jhawkins) Remove this hack when the Linux printing refactoring
56 // finishes. 56 // finishes.
57 dpi = kPixelsPerInch; 57 dpi = kPixelsPerInch;
58 double page_width_in_pixel = 8.5 * dpi; 58 double page_width_in_pixel = 8.5 * dpi;
59 double page_height_in_pixel = 11.0 * dpi; 59 double page_height_in_pixel = 11.0 * dpi;
60 physical_size_device_units.SetSize( 60 physical_size_device_units.SetSize(
61 static_cast<int>(page_width_in_pixel), 61 static_cast<int>(page_width_in_pixel),
62 static_cast<int>(page_height_in_pixel)); 62 static_cast<int>(page_height_in_pixel));
63 printable_area_device_units.SetRect( 63 printable_area_device_units.SetRect(
64 static_cast<int>( 64 static_cast<int>(
65 NativeMetafile::kLeftMarginInInch * printing::kPixelsPerInch), 65 NativeMetafile::kLeftMarginInInch * dpi),
66 static_cast<int>( 66 static_cast<int>(
67 NativeMetafile::kTopMarginInInch * printing::kPixelsPerInch), 67 NativeMetafile::kTopMarginInInch * dpi),
68 page_width_in_pixel, 68 page_width_in_pixel -
69 page_height_in_pixel); 69 (NativeMetafile::kLeftMarginInInch +
70 NativeMetafile::kRightMarginInInch) * dpi,
71 page_height_in_pixel -
72 (NativeMetafile::kTopMarginInInch +
73 NativeMetafile::kBottomMarginInInch) * dpi);
70 } 74 }
71 75
72 print_settings->set_dpi(dpi); 76 print_settings->set_dpi(dpi);
73 print_settings->SetPrinterPrintableArea(physical_size_device_units, 77 print_settings->SetPrinterPrintableArea(physical_size_device_units,
74 printable_area_device_units, 78 printable_area_device_units,
75 dpi); 79 dpi);
76 } 80 }
77 81
78 } // namespace printing 82 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698