Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 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 | |
Lei Zhang | be4236bc | 2023-04-27 18:54:08 | [diff] [blame] | 8 | #include "build/chromeos_buildflags.h" |
Gyuyoung Kim | f9d551d | 2020-02-20 00:50:21 | [diff] [blame] | 9 | #include "components/printing/common/print.mojom-forward.h" |
Julie Jeongeun Kim | 52b2da7 | 2019-11-20 00:02:35 | [diff] [blame] | 10 | #include "mojo/public/cpp/bindings/pending_associated_remote.h" |
Scott Violet | 318a55f | 2018-03-30 19:08:19 | [diff] [blame] | 11 | #include "printing/buildflags/buildflags.h" |
Brett Wilson | 65f951c | 2016-11-03 22:06:12 | [diff] [blame] | 12 | |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 13 | namespace content { |
thestig | cb959ce | 2016-11-17 05:56:32 | [diff] [blame] | 14 | class RenderFrameHost; |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 15 | class WebContents; |
| 16 | } |
| 17 | |
| 18 | namespace printing { |
| 19 | |
| 20 | // Start printing using the appropriate PrintViewManagerBase subclass. |
Jesse Schettler | fd3df7e8 | 2019-09-16 23:23:18 | [diff] [blame] | 21 | // Optionally provide a printing::mojom::PrintRenderer to render print |
| 22 | // documents. |
Julie Jeongeun Kim | 52b2da7 | 2019-11-20 00:02:35 | [diff] [blame] | 23 | void StartPrint( |
| 24 | content::WebContents* web_contents, |
Lei Zhang | be4236bc | 2023-04-27 18:54:08 | [diff] [blame] | 25 | #if BUILDFLAG(IS_CHROMEOS_ASH) |
Julie Jeongeun Kim | 52b2da7 | 2019-11-20 00:02:35 | [diff] [blame] | 26 | mojo::PendingAssociatedRemote<mojom::PrintRenderer> print_renderer, |
Lei Zhang | be4236bc | 2023-04-27 18:54:08 | [diff] [blame] | 27 | #endif |
Julie Jeongeun Kim | 52b2da7 | 2019-11-20 00:02:35 | [diff] [blame] | 28 | bool print_preview_disabled, |
| 29 | bool has_selection); |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 30 | |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 31 | // Start printing using the system print dialog. |
| 32 | void StartBasicPrint(content::WebContents* contents); |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 33 | |
Lei Zhang | 862c6f57a | 2023-06-16 21:44:28 | [diff] [blame] | 34 | // Start printing the node under the context menu using the appropriate |
| 35 | // PrintViewManagerBase subclass. |
| 36 | void StartPrintNodeUnderContextMenu(content::RenderFrameHost* rfh, |
| 37 | bool print_preview_disabled); |
| 38 | |
thestig | cb959ce | 2016-11-17 05:56:32 | [diff] [blame] | 39 | // If the user has selected text in the currently focused frame, print only that |
| 40 | // frame (this makes print selection work for multiple frames). |
| 41 | content::RenderFrameHost* GetFrameToPrint(content::WebContents* contents); |
| 42 | |
Jesse Schettler | 1cf12be | 2019-08-15 21:28:11 | [diff] [blame] | 43 | // If we have a single full-page embedded mime handler view guest, print the |
Antia Puentes | d88bb31e | 2022-10-17 18:44:49 | [diff] [blame] | 44 | // guest view instead. |
| 45 | content::RenderFrameHost* GetFullPagePlugin(content::WebContents* contents); |
Jesse Schettler | 1cf12be | 2019-08-15 21:28:11 | [diff] [blame] | 46 | |
sammc | 3d0df3a | 2014-11-24 21:25:38 | [diff] [blame] | 47 | } // namespace printing |
| 48 | |
| 49 | #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_ |