| 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 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1882 | 1882 |
| 1883 // TODO(thestig): Figure out why Linux is different. | 1883 // TODO(thestig): Figure out why Linux is different. |
| 1884 #if defined(OS_WIN) | 1884 #if defined(OS_WIN) |
| 1885 float webkit_page_shrink_factor = | 1885 float webkit_page_shrink_factor = |
| 1886 frame->getPrintPageShrink(params.page_number); | 1886 frame->getPrintPageShrink(params.page_number); |
| 1887 float scale_factor = css_scale_factor * webkit_page_shrink_factor; | 1887 float scale_factor = css_scale_factor * webkit_page_shrink_factor; |
| 1888 #else | 1888 #else |
| 1889 float scale_factor = css_scale_factor; | 1889 float scale_factor = css_scale_factor; |
| 1890 #endif | 1890 #endif |
| 1891 | 1891 |
| 1892 SkCanvas* canvas = metafile->GetVectorCanvasForNewPage( | 1892 cc::PaintCanvas* canvas = |
| 1893 page_size, canvas_area, scale_factor); | 1893 metafile->GetVectorCanvasForNewPage(page_size, canvas_area, scale_factor); |
| 1894 if (!canvas) | 1894 if (!canvas) |
| 1895 return; | 1895 return; |
| 1896 | 1896 |
| 1897 MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); | 1897 MetafileSkiaWrapper::SetMetafileOnCanvas(canvas, metafile); |
| 1898 | 1898 |
| 1899 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 1899 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 1900 if (params.params.display_header_footer) { | 1900 if (params.params.display_header_footer) { |
| 1901 // TODO(thestig): Figure out why Linux needs this. It is almost certainly | 1901 // TODO(thestig): Figure out why Linux needs this. It is almost certainly |
| 1902 // |printingMinimumShrinkFactor| from Blink. | 1902 // |printingMinimumShrinkFactor| from Blink. |
| 1903 #if defined(OS_WIN) | 1903 #if defined(OS_WIN) |
| 1904 const float fudge_factor = 1; | 1904 const float fudge_factor = 1; |
| 1905 #else | 1905 #else |
| 1906 const float fudge_factor = kPrintingMinimumShrinkFactor; | 1906 const float fudge_factor = kPrintingMinimumShrinkFactor; |
| 1907 #endif | 1907 #endif |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2360 blink::WebConsoleMessage::LevelWarning, message)); | 2360 blink::WebConsoleMessage::LevelWarning, message)); |
| 2361 return false; | 2361 return false; |
| 2362 } | 2362 } |
| 2363 | 2363 |
| 2364 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2364 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
| 2365 // Reset counter on successful print. | 2365 // Reset counter on successful print. |
| 2366 count_ = 0; | 2366 count_ = 0; |
| 2367 } | 2367 } |
| 2368 | 2368 |
| 2369 } // namespace printing | 2369 } // namespace printing |
| OLD | NEW |