OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" | 5 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" |
6 | 6 |
7 #include "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
9 #include "printing/printing_context.h" | 9 #include "printing/printing_context.h" |
10 #include "printing/units.h" | 10 #include "printing/units.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 #if defined(ENABLE_PRINTING) | 16 #if defined(ENABLE_FULL_PRINTING) |
17 // Print units conversion functions. | 17 // Print units conversion functions. |
18 int32_t DeviceUnitsInPoints(int32_t device_units, | 18 int32_t DeviceUnitsInPoints(int32_t device_units, |
19 int32_t device_units_per_inch) { | 19 int32_t device_units_per_inch) { |
20 return printing::ConvertUnit(device_units, device_units_per_inch, | 20 return printing::ConvertUnit(device_units, device_units_per_inch, |
21 printing::kPointsPerInch); | 21 printing::kPointsPerInch); |
22 } | 22 } |
23 | 23 |
24 PP_Size PrintSizeToPPPrintSize(const gfx::Size& print_size, | 24 PP_Size PrintSizeToPPPrintSize(const gfx::Size& print_size, |
25 int32_t device_units_per_inch) { | 25 int32_t device_units_per_inch) { |
26 PP_Size result; | 26 PP_Size result; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 } // namespace | 93 } // namespace |
94 | 94 |
95 void PepperPrintSettingsManagerImpl::GetDefaultPrintSettings( | 95 void PepperPrintSettingsManagerImpl::GetDefaultPrintSettings( |
96 PepperPrintSettingsManager::Callback callback) { | 96 PepperPrintSettingsManager::Callback callback) { |
97 BrowserThread::PostTaskAndReplyWithResult(BrowserThread::UI, FROM_HERE, | 97 BrowserThread::PostTaskAndReplyWithResult(BrowserThread::UI, FROM_HERE, |
98 base::Bind(ComputeDefaultPrintSettings), callback); | 98 base::Bind(ComputeDefaultPrintSettings), callback); |
99 } | 99 } |
100 | 100 |
101 } // namespace content | 101 } // namespace content |
OLD | NEW |