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/printing_context.h" | 11 #include "printing/printing_context.h" |
12 #include "printing/units.h" | 12 #include "printing/units.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 #if defined(ENABLE_FULL_PRINTING) | 18 #if defined(ENABLE_PRINT_PREVIEW) |
19 // Print units conversion functions. | 19 // Print units conversion functions. |
20 int32_t DeviceUnitsInPoints(int32_t device_units, | 20 int32_t DeviceUnitsInPoints(int32_t device_units, |
21 int32_t device_units_per_inch) { | 21 int32_t device_units_per_inch) { |
22 return printing::ConvertUnit( | 22 return printing::ConvertUnit( |
23 device_units, device_units_per_inch, printing::kPointsPerInch); | 23 device_units, device_units_per_inch, printing::kPointsPerInch); |
24 } | 24 } |
25 | 25 |
26 PP_Size PrintSizeToPPPrintSize(const gfx::Size& print_size, | 26 PP_Size PrintSizeToPPPrintSize(const gfx::Size& print_size, |
27 int32_t device_units_per_inch) { | 27 int32_t device_units_per_inch) { |
28 PP_Size result; | 28 PP_Size result; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void PepperPrintSettingsManagerImpl::GetDefaultPrintSettings( | 108 void PepperPrintSettingsManagerImpl::GetDefaultPrintSettings( |
109 PepperPrintSettingsManager::Callback callback) { | 109 PepperPrintSettingsManager::Callback callback) { |
110 BrowserThread::PostTaskAndReplyWithResult( | 110 BrowserThread::PostTaskAndReplyWithResult( |
111 BrowserThread::UI, | 111 BrowserThread::UI, |
112 FROM_HERE, | 112 FROM_HERE, |
113 base::Bind(ComputeDefaultPrintSettings), | 113 base::Bind(ComputeDefaultPrintSettings), |
114 callback); | 114 callback); |
115 } | 115 } |
116 | 116 |
117 } // namespace content | 117 } // namespace content |
OLD | NEW |