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 | |
Scott Violet | 318a55f | 2018-03-30 19:08:19 | [diff] [blame^] | 8 | #include "printing/buildflags/buildflags.h" |
Brett Wilson | 65f951c | 2016-11-03 22:06:12 | [diff] [blame] | 9 | |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 10 | namespace content { |
thestig | cb959ce | 2016-11-17 05:56:32 | [diff] [blame] | 11 | class RenderFrameHost; |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 12 | class WebContents; |
| 13 | } |
| 14 | |
| 15 | namespace printing { |
| 16 | |
| 17 | // Start printing using the appropriate PrintViewManagerBase subclass. |
| 18 | void StartPrint(content::WebContents* web_contents, |
| 19 | bool print_preview_disabled, |
thestig | cb959ce | 2016-11-17 05:56:32 | [diff] [blame] | 20 | bool has_selection); |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 21 | |
Brett Wilson | 65f951c | 2016-11-03 22:06:12 | [diff] [blame] | 22 | #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 23 | // Start printing using the system print dialog. |
| 24 | void StartBasicPrint(content::WebContents* contents); |
| 25 | #endif |
| 26 | |
thestig | cb959ce | 2016-11-17 05:56:32 | [diff] [blame] | 27 | // If the user has selected text in the currently focused frame, print only that |
| 28 | // frame (this makes print selection work for multiple frames). |
| 29 | content::RenderFrameHost* GetFrameToPrint(content::WebContents* contents); |
| 30 | |
Wei Li | 68aabd9 | 2018-03-12 22:36:47 | [diff] [blame] | 31 | // Whether the content sent to |rfh| is in PDF format. |
| 32 | // When print preview dialog is printed, the content returned is always |
| 33 | // in PDF format because print preview already stores the PDF file for |
| 34 | // the previewed web page; When a full page PDF plugin is printed, the document |
| 35 | // in it is in PDF format so will return in PDF also. |
| 36 | bool PrintingPdfContent(content::RenderFrameHost* rfh); |
| 37 | |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 38 | } // namespace printing |
| 39 | |
| 40 | #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_ |