| 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_win.h" | 5 #include "printing/print_settings_initializer_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "printing/print_settings.h" | 9 #include "printing/print_settings.h" |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 GetDeviceCaps(hdc, HORZRES), | 41 GetDeviceCaps(hdc, HORZRES), |
| 42 GetDeviceCaps(hdc, VERTRES)); | 42 GetDeviceCaps(hdc, VERTRES)); |
| 43 | 43 |
| 44 // Sanity check the printable_area: we've seen crashes caused by a printable | 44 // Sanity check the printable_area: we've seen crashes caused by a printable |
| 45 // area rect of 0, 0, 0, 0, so it seems some drivers don't set it. | 45 // area rect of 0, 0, 0, 0, so it seems some drivers don't set it. |
| 46 if (printable_area_device_units.IsEmpty() || | 46 if (printable_area_device_units.IsEmpty() || |
| 47 !gfx::Rect(physical_size_device_units).Contains( | 47 !gfx::Rect(physical_size_device_units).Contains( |
| 48 printable_area_device_units)) { | 48 printable_area_device_units)) { |
| 49 printable_area_device_units = gfx::Rect(physical_size_device_units); | 49 printable_area_device_units = gfx::Rect(physical_size_device_units); |
| 50 } | 50 } |
| 51 | 51 DCHECK_EQ(print_settings->device_units_per_inch(), dpi); |
| 52 print_settings->SetPrinterPrintableArea(physical_size_device_units, | 52 print_settings->SetPrinterPrintableArea(physical_size_device_units, |
| 53 printable_area_device_units, | 53 printable_area_device_units, |
| 54 dpi, false); | 54 false); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace printing | 57 } // namespace printing |
| OLD | NEW |