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

Side by Side Diff: components/printing/renderer/print_web_view_helper_pdf_win.cc

Issue 1457033002: Get rid of unused skia::IsDraftMode() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig review Created 5 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 | « components/printing/renderer/print_web_view_helper_mac.mm ('k') | skia/ext/platform_device.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/process/process_handle.h" 9 #include "base/process/process_handle.h"
10 #include "components/printing/common/print_messages.h" 10 #include "components/printing/common/print_messages.h"
11 #include "content/public/renderer/render_thread.h" 11 #include "content/public/renderer/render_thread.h"
12 #include "printing/metafile_skia_wrapper.h" 12 #include "printing/metafile_skia_wrapper.h"
13 #include "printing/page_size_margins.h" 13 #include "printing/page_size_margins.h"
14 #include "printing/pdf_metafile_skia.h" 14 #include "printing/pdf_metafile_skia.h"
15 #include "printing/units.h" 15 #include "printing/units.h"
16 #include "skia/ext/platform_device.h"
17 #include "third_party/WebKit/public/web/WebLocalFrame.h" 16 #include "third_party/WebKit/public/web/WebLocalFrame.h"
18 17
19 namespace printing { 18 namespace printing {
20 19
21 using blink::WebFrame; 20 using blink::WebFrame;
22 21
23 bool PrintWebViewHelper::RenderPreviewPage( 22 bool PrintWebViewHelper::RenderPreviewPage(
24 int page_number, 23 int page_number,
25 const PrintMsg_Print_Params& print_params) { 24 const PrintMsg_Print_Params& print_params) {
26 PrintMsg_PrintPage_Params page_params; 25 PrintMsg_PrintPage_Params page_params;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 float webkit_page_shrink_factor = 152 float webkit_page_shrink_factor =
154 frame->getPrintPageShrink(params.page_number); 153 frame->getPrintPageShrink(params.page_number);
155 float scale_factor = css_scale_factor * webkit_page_shrink_factor; 154 float scale_factor = css_scale_factor * webkit_page_shrink_factor;
156 155
157 skia::PlatformCanvas* canvas = 156 skia::PlatformCanvas* canvas =
158 metafile->GetVectorCanvasForNewPage(page_size, canvas_area, scale_factor); 157 metafile->GetVectorCanvasForNewPage(page_size, canvas_area, scale_factor);
159 if (!canvas) 158 if (!canvas)
160 return; 159 return;
161 160
162 MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); 161 MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
163 skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_);
164 162
165 #if defined(ENABLE_PRINT_PREVIEW) 163 #if defined(ENABLE_PRINT_PREVIEW)
166 if (params.params.display_header_footer) { 164 if (params.params.display_header_footer) {
167 // |page_number| is 0-based, so 1 is added. 165 // |page_number| is 0-based, so 1 is added.
168 PrintHeaderAndFooter(canvas, params.page_number + 1, 166 PrintHeaderAndFooter(canvas, params.page_number + 1,
169 print_preview_context_.total_page_count(), *frame, 167 print_preview_context_.total_page_count(), *frame,
170 scale_factor, page_layout_in_points, params.params); 168 scale_factor, page_layout_in_points, params.params);
171 } 169 }
172 #endif // defined(ENABLE_PRINT_PREVIEW) 170 #endif // defined(ENABLE_PRINT_PREVIEW)
173 171
(...skipping 26 matching lines...) Expand all
200 shared_mem_handle)) { 198 shared_mem_handle)) {
201 return false; 199 return false;
202 } 200 }
203 201
204 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle, 202 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle,
205 shared_mem_handle)); 203 shared_mem_handle));
206 return true; 204 return true;
207 } 205 }
208 206
209 } // namespace printing 207 } // namespace printing
OLDNEW
« no previous file with comments | « components/printing/renderer/print_web_view_helper_mac.mm ('k') | skia/ext/platform_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698