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 "content/public/browser/content_browser_client.h" | 8 #include "content/public/browser/content_browser_client.h" |
9 #include "content/public/common/content_client.h" | 9 #include "content/public/common/content_client.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| 11 #include "printing/features/features.h" |
11 | 12 |
12 #if defined(ENABLE_PRINT_PREVIEW) | 13 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
13 #include "printing/printing_context.h" // nogncheck | 14 #include "printing/printing_context.h" // nogncheck |
14 #include "printing/units.h" // nogncheck | 15 #include "printing/units.h" // nogncheck |
15 #endif | 16 #endif |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 #if defined(ENABLE_PRINT_PREVIEW) | 22 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
22 // Print units conversion functions. | 23 // Print units conversion functions. |
23 int32_t DeviceUnitsInPoints(int32_t device_units, | 24 int32_t DeviceUnitsInPoints(int32_t device_units, |
24 int32_t device_units_per_inch) { | 25 int32_t device_units_per_inch) { |
25 return printing::ConvertUnit( | 26 return printing::ConvertUnit( |
26 device_units, device_units_per_inch, printing::kPointsPerInch); | 27 device_units, device_units_per_inch, printing::kPointsPerInch); |
27 } | 28 } |
28 | 29 |
29 PP_Size PrintSizeToPPPrintSize(const gfx::Size& print_size, | 30 PP_Size PrintSizeToPPPrintSize(const gfx::Size& print_size, |
30 int32_t device_units_per_inch) { | 31 int32_t device_units_per_inch) { |
31 PP_Size result; | 32 PP_Size result; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 void PepperPrintSettingsManagerImpl::GetDefaultPrintSettings( | 112 void PepperPrintSettingsManagerImpl::GetDefaultPrintSettings( |
112 PepperPrintSettingsManager::Callback callback) { | 113 PepperPrintSettingsManager::Callback callback) { |
113 BrowserThread::PostTaskAndReplyWithResult( | 114 BrowserThread::PostTaskAndReplyWithResult( |
114 BrowserThread::UI, | 115 BrowserThread::UI, |
115 FROM_HERE, | 116 FROM_HERE, |
116 base::Bind(ComputeDefaultPrintSettings), | 117 base::Bind(ComputeDefaultPrintSettings), |
117 callback); | 118 callback); |
118 } | 119 } |
119 | 120 |
120 } // namespace content | 121 } // namespace content |
OLD | NEW |