OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "components/prefs/pref_member.h" | 12 #include "components/prefs/pref_member.h" |
13 #include "components/printing/browser/print_manager.h" | 13 #include "components/printing/browser/print_manager.h" |
14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
| 16 #include "printing/features/features.h" |
16 #include "printing/printed_pages_source.h" | 17 #include "printing/printed_pages_source.h" |
17 | 18 |
18 struct PrintHostMsg_DidPrintPage_Params; | 19 struct PrintHostMsg_DidPrintPage_Params; |
19 | 20 |
20 namespace printing { | 21 namespace printing { |
21 | 22 |
22 class JobEventDetails; | 23 class JobEventDetails; |
23 class MetafilePlayer; | 24 class MetafilePlayer; |
24 class PrintJob; | 25 class PrintJob; |
25 class PrintJobWorkerOwner; | 26 class PrintJobWorkerOwner; |
26 class PrintQueriesQueue; | 27 class PrintQueriesQueue; |
27 | 28 |
28 // Base class for managing the print commands for a WebContents. | 29 // Base class for managing the print commands for a WebContents. |
29 class PrintViewManagerBase : public content::NotificationObserver, | 30 class PrintViewManagerBase : public content::NotificationObserver, |
30 public PrintedPagesSource, | 31 public PrintedPagesSource, |
31 public PrintManager { | 32 public PrintManager { |
32 public: | 33 public: |
33 ~PrintViewManagerBase() override; | 34 ~PrintViewManagerBase() override; |
34 | 35 |
35 #if defined(ENABLE_BASIC_PRINTING) | 36 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
36 // Prints the current document immediately. Since the rendering is | 37 // Prints the current document immediately. Since the rendering is |
37 // asynchronous, the actual printing will not be completed on the return of | 38 // asynchronous, the actual printing will not be completed on the return of |
38 // this function. Returns false if printing is impossible at the moment. | 39 // this function. Returns false if printing is impossible at the moment. |
39 virtual bool PrintNow(); | 40 virtual bool PrintNow(); |
40 #endif // ENABLE_BASIC_PRINTING | 41 #endif // ENABLE_BASIC_PRINTING |
41 | 42 |
42 // Whether to block scripted printing for our tab or not. | 43 // Whether to block scripted printing for our tab or not. |
43 void UpdateScriptedPrintingBlocked(); | 44 void UpdateScriptedPrintingBlocked(); |
44 | 45 |
45 // PrintedPagesSource implementation. | 46 // PrintedPagesSource implementation. |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 BooleanPrefMember printing_enabled_; | 149 BooleanPrefMember printing_enabled_; |
149 | 150 |
150 scoped_refptr<printing::PrintQueriesQueue> queue_; | 151 scoped_refptr<printing::PrintQueriesQueue> queue_; |
151 | 152 |
152 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); | 153 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); |
153 }; | 154 }; |
154 | 155 |
155 } // namespace printing | 156 } // namespace printing |
156 | 157 |
157 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 158 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
OLD | NEW |