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

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

Issue 2524143003: Print Preview: Add option to rasterize PDFs and add JPEG compression. (Closed)
Patch Set: Clean up JS Created 3 years, 12 months 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 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 page_params->printable_area.set_size( 278 page_params->printable_area.set_size(
279 gfx::Size(page_params->printable_area.height(), 279 gfx::Size(page_params->printable_area.height(),
280 page_params->printable_area.width())); 280 page_params->printable_area.width()));
281 } 281 }
282 282
283 void ComputeWebKitPrintParamsInDesiredDpi( 283 void ComputeWebKitPrintParamsInDesiredDpi(
284 const PrintMsg_Print_Params& print_params, 284 const PrintMsg_Print_Params& print_params,
285 blink::WebPrintParams* webkit_print_params) { 285 blink::WebPrintParams* webkit_print_params) {
286 int dpi = GetDPI(&print_params); 286 int dpi = GetDPI(&print_params);
287 webkit_print_params->printerDPI = dpi; 287 webkit_print_params->printerDPI = dpi;
288 webkit_print_params->rasterizePDF = print_params.rasterize_pdf;
288 webkit_print_params->printScalingOption = print_params.print_scaling_option; 289 webkit_print_params->printScalingOption = print_params.print_scaling_option;
289 290
290 webkit_print_params->printContentArea.width = ConvertUnit( 291 webkit_print_params->printContentArea.width = ConvertUnit(
291 print_params.content_size.width(), dpi, print_params.desired_dpi); 292 print_params.content_size.width(), dpi, print_params.desired_dpi);
292 webkit_print_params->printContentArea.height = ConvertUnit( 293 webkit_print_params->printContentArea.height = ConvertUnit(
293 print_params.content_size.height(), dpi, print_params.desired_dpi); 294 print_params.content_size.height(), dpi, print_params.desired_dpi);
294 295
295 webkit_print_params->printableArea.x = ConvertUnit( 296 webkit_print_params->printableArea.x = ConvertUnit(
296 print_params.printable_area.x(), dpi, print_params.desired_dpi); 297 print_params.printable_area.x(), dpi, print_params.desired_dpi);
297 webkit_print_params->printableArea.y = ConvertUnit( 298 webkit_print_params->printableArea.y = ConvertUnit(
(...skipping 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after
2342 blink::WebConsoleMessage::LevelWarning, message)); 2343 blink::WebConsoleMessage::LevelWarning, message));
2343 return false; 2344 return false;
2344 } 2345 }
2345 2346
2346 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2347 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2347 // Reset counter on successful print. 2348 // Reset counter on successful print.
2348 count_ = 0; 2349 count_ = 0;
2349 } 2350 }
2350 2351
2351 } // namespace printing 2352 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698