sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_ |
| 6 | #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_ |
| 7 | |
Jesse Schettler | fd3df7e8 | 2019-09-16 23:23:18 | [diff] [blame^] | 8 | #include "components/printing/common/print.mojom.h" |
Scott Violet | 318a55f | 2018-03-30 19:08:19 | [diff] [blame] | 9 | #include "printing/buildflags/buildflags.h" |
Brett Wilson | 65f951c | 2016-11-03 22:06:12 | [diff] [blame] | 10 | |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 11 | namespace content { |
thestig | cb959ce | 2016-11-17 05:56:32 | [diff] [blame] | 12 | class RenderFrameHost; |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 13 | class WebContents; |
| 14 | } |
| 15 | |
| 16 | namespace printing { |
| 17 | |
| 18 | // Start printing using the appropriate PrintViewManagerBase subclass. |
Jesse Schettler | fd3df7e8 | 2019-09-16 23:23:18 | [diff] [blame^] | 19 | // Optionally provide a printing::mojom::PrintRenderer to render print |
| 20 | // documents. |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 21 | void StartPrint(content::WebContents* web_contents, |
Jesse Schettler | fd3df7e8 | 2019-09-16 23:23:18 | [diff] [blame^] | 22 | mojom::PrintRendererAssociatedPtrInfo print_renderer, |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 23 | bool print_preview_disabled, |
thestig | cb959ce | 2016-11-17 05:56:32 | [diff] [blame] | 24 | bool has_selection); |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 25 | |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 26 | // Start printing using the system print dialog. |
| 27 | void StartBasicPrint(content::WebContents* contents); |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 28 | |
thestig | cb959ce | 2016-11-17 05:56:32 | [diff] [blame] | 29 | // If the user has selected text in the currently focused frame, print only that |
| 30 | // frame (this makes print selection work for multiple frames). |
| 31 | content::RenderFrameHost* GetFrameToPrint(content::WebContents* contents); |
| 32 | |
Jesse Schettler | 1cf12be | 2019-08-15 21:28:11 | [diff] [blame] | 33 | // If we have a single full-page embedded mime handler view guest, print the |
| 34 | // guest's WebContents instead. |
| 35 | content::WebContents* GetWebContentsToUse(content::WebContents* contents); |
| 36 | |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 37 | } // namespace printing |
| 38 | |
| 39 | #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_ |