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

Side by Side Diff: components/printing/renderer/print_web_view_helper_linux.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
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 "components/printing/renderer/print_web_view_helper.h" 5 #include "components/printing/renderer/print_web_view_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "components/printing/common/print_messages.h" 11 #include "components/printing/common/print_messages.h"
12 #include "printing/features/features.h"
12 #include "printing/metafile_skia_wrapper.h" 13 #include "printing/metafile_skia_wrapper.h"
13 14
14 #if defined(OS_ANDROID) 15 #if defined(OS_ANDROID)
15 #include "base/file_descriptor_posix.h" 16 #include "base/file_descriptor_posix.h"
16 #else 17 #else
17 #include "base/process/process_handle.h" 18 #include "base/process/process_handle.h"
18 #endif // defined(OS_ANDROID) 19 #endif // defined(OS_ANDROID)
19 20
20 namespace { 21 namespace {
21 22
(...skipping 13 matching lines...) Expand all
35 if (!fd.auto_close) 36 if (!fd.auto_close)
36 file.TakePlatformFile(); 37 file.TakePlatformFile();
37 return result; 38 return result;
38 } 39 }
39 #endif // defined(OS_ANDROID) 40 #endif // defined(OS_ANDROID)
40 41
41 } // namespace 42 } // namespace
42 43
43 namespace printing { 44 namespace printing {
44 45
45 #if defined(ENABLE_BASIC_PRINTING) 46 #if BUILDFLAG(ENABLE_BASIC_PRINTING)
46 bool PrintWebViewHelper::PrintPagesNative(blink::WebLocalFrame* frame, 47 bool PrintWebViewHelper::PrintPagesNative(blink::WebLocalFrame* frame,
47 int page_count) { 48 int page_count) {
48 PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE); 49 PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
49 CHECK(metafile.Init()); 50 CHECK(metafile.Init());
50 51
51 const PrintMsg_PrintPages_Params& params = *print_pages_params_; 52 const PrintMsg_PrintPages_Params& params = *print_pages_params_;
52 std::vector<int> printed_pages = GetPrintedPages(params, page_count); 53 std::vector<int> printed_pages = GetPrintedPages(params, page_count);
53 if (printed_pages.empty()) 54 if (printed_pages.empty())
54 return false; 55 return false;
55 56
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 94
94 for (size_t i = 0; i < printed_pages.size(); ++i) { 95 for (size_t i = 0; i < printed_pages.size(); ++i) {
95 printed_page_params.page_number = printed_pages[i]; 96 printed_page_params.page_number = printed_pages[i];
96 Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params)); 97 Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params));
97 // Send the rest of the pages with an invalid metafile handle. 98 // Send the rest of the pages with an invalid metafile handle.
98 printed_page_params.metafile_data_handle.fd = -1; 99 printed_page_params.metafile_data_handle.fd = -1;
99 } 100 }
100 return true; 101 return true;
101 #endif // defined(OS_ANDROID) 102 #endif // defined(OS_ANDROID)
102 } 103 }
103 #endif // defined(ENABLE_BASIC_PRINTING) 104 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
104 105
105 } // namespace printing 106 } // namespace printing
OLDNEW
« no previous file with comments | « components/printing/renderer/print_web_view_helper.cc ('k') | components/printing/renderer/print_web_view_helper_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698