Chromium Code Reviews| 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 "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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 } | 282 } |
| 283 | 283 |
| 284 void ComputeWebKitPrintParamsInDesiredDpi( | 284 void ComputeWebKitPrintParamsInDesiredDpi( |
| 285 const PrintMsg_Print_Params& print_params, | 285 const PrintMsg_Print_Params& print_params, |
| 286 blink::WebPrintParams* webkit_print_params) { | 286 blink::WebPrintParams* webkit_print_params) { |
| 287 int dpi = GetDPI(&print_params); | 287 int dpi = GetDPI(&print_params); |
| 288 webkit_print_params->printerDPI = dpi; | 288 webkit_print_params->printerDPI = dpi; |
| 289 webkit_print_params->rasterizePDF = print_params.rasterize_pdf; | 289 webkit_print_params->rasterizePDF = print_params.rasterize_pdf; |
| 290 webkit_print_params->printScalingOption = print_params.print_scaling_option; | 290 webkit_print_params->printScalingOption = print_params.print_scaling_option; |
| 291 | 291 |
| 292 webkit_print_params->printContentArea.width = ConvertUnit( | 292 webkit_print_params->printContentArea.width = |
| 293 print_params.content_size.width(), dpi, print_params.desired_dpi); | 293 ConvertUnit(print_params.content_size.width(), dpi, kPointsPerInch); |
|
Lei Zhang
2017/03/31 22:21:13
By doing this, I don't think there are any more us
rbpotter
2017/04/01 00:08:01
Acknowledged.
| |
| 294 webkit_print_params->printContentArea.height = ConvertUnit( | 294 webkit_print_params->printContentArea.height = |
| 295 print_params.content_size.height(), dpi, print_params.desired_dpi); | 295 ConvertUnit(print_params.content_size.height(), dpi, kPointsPerInch); |
| 296 | 296 |
| 297 webkit_print_params->printableArea.x = ConvertUnit( | 297 webkit_print_params->printableArea.x = |
| 298 print_params.printable_area.x(), dpi, print_params.desired_dpi); | 298 ConvertUnit(print_params.printable_area.x(), dpi, kPointsPerInch); |
| 299 webkit_print_params->printableArea.y = ConvertUnit( | 299 webkit_print_params->printableArea.y = |
| 300 print_params.printable_area.y(), dpi, print_params.desired_dpi); | 300 ConvertUnit(print_params.printable_area.y(), dpi, kPointsPerInch); |
| 301 webkit_print_params->printableArea.width = ConvertUnit( | 301 webkit_print_params->printableArea.width = |
| 302 print_params.printable_area.width(), dpi, print_params.desired_dpi); | 302 ConvertUnit(print_params.printable_area.width(), dpi, kPointsPerInch); |
| 303 webkit_print_params->printableArea.height = ConvertUnit( | 303 webkit_print_params->printableArea.height = |
| 304 print_params.printable_area.height(), dpi, print_params.desired_dpi); | 304 ConvertUnit(print_params.printable_area.height(), dpi, kPointsPerInch); |
| 305 | 305 |
| 306 webkit_print_params->paperSize.width = ConvertUnit( | 306 webkit_print_params->paperSize.width = |
| 307 print_params.page_size.width(), dpi, print_params.desired_dpi); | 307 ConvertUnit(print_params.page_size.width(), dpi, kPointsPerInch); |
| 308 webkit_print_params->paperSize.height = ConvertUnit( | 308 webkit_print_params->paperSize.height = |
| 309 print_params.page_size.height(), dpi, print_params.desired_dpi); | 309 ConvertUnit(print_params.page_size.height(), dpi, kPointsPerInch); |
| 310 } | 310 } |
| 311 | 311 |
| 312 blink::WebPlugin* GetPlugin(const blink::WebLocalFrame* frame) { | 312 blink::WebPlugin* GetPlugin(const blink::WebLocalFrame* frame) { |
| 313 return frame->document().isPluginDocument() | 313 return frame->document().isPluginDocument() |
| 314 ? frame->document().to<blink::WebPluginDocument>().plugin() | 314 ? frame->document().to<blink::WebPluginDocument>().plugin() |
| 315 : NULL; | 315 : NULL; |
| 316 } | 316 } |
| 317 | 317 |
| 318 bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, | 318 bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, |
| 319 const blink::WebNode& node) { | 319 const blink::WebNode& node) { |
| (...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2369 blink::WebConsoleMessage::LevelWarning, message)); | 2369 blink::WebConsoleMessage::LevelWarning, message)); |
| 2370 return false; | 2370 return false; |
| 2371 } | 2371 } |
| 2372 | 2372 |
| 2373 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2373 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
| 2374 // Reset counter on successful print. | 2374 // Reset counter on successful print. |
| 2375 count_ = 0; | 2375 count_ = 0; |
| 2376 } | 2376 } |
| 2377 | 2377 |
| 2378 } // namespace printing | 2378 } // namespace printing |
| OLD | NEW |