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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_print_settings_manager.cc

Issue 2458833005: Move printing defines to buildflag system. (Closed)
Patch Set: Merge Created 4 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 | « content/browser/BUILD.gn ('k') | content/renderer/BUILD.gn » ('j') | 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) 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
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
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698