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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/prefs/pref_member.h" | 9 #include "base/prefs/pref_member.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class PrintJobWorkerOwner; | 28 class PrintJobWorkerOwner; |
29 class PrintQueriesQueue; | 29 class PrintQueriesQueue; |
30 | 30 |
31 // Base class for managing the print commands for a WebContents. | 31 // Base class for managing the print commands for a WebContents. |
32 class PrintViewManagerBase : public content::NotificationObserver, | 32 class PrintViewManagerBase : public content::NotificationObserver, |
33 public PrintedPagesSource, | 33 public PrintedPagesSource, |
34 public content::WebContentsObserver { | 34 public content::WebContentsObserver { |
35 public: | 35 public: |
36 virtual ~PrintViewManagerBase(); | 36 virtual ~PrintViewManagerBase(); |
37 | 37 |
| 38 #if !defined(DISABLE_BASIC_PRINTING) |
38 // Prints the current document immediately. Since the rendering is | 39 // Prints the current document immediately. Since the rendering is |
39 // asynchronous, the actual printing will not be completed on the return of | 40 // asynchronous, the actual printing will not be completed on the return of |
40 // this function. Returns false if printing is impossible at the moment. | 41 // this function. Returns false if printing is impossible at the moment. |
41 virtual bool PrintNow(); | 42 virtual bool PrintNow(); |
| 43 #endif // !DISABLE_BASIC_PRINTING |
42 | 44 |
43 // Whether to block scripted printing for our tab or not. | 45 // Whether to block scripted printing for our tab or not. |
44 void UpdateScriptedPrintingBlocked(); | 46 void UpdateScriptedPrintingBlocked(); |
45 | 47 |
46 // PrintedPagesSource implementation. | 48 // PrintedPagesSource implementation. |
47 virtual base::string16 RenderSourceName() OVERRIDE; | 49 virtual base::string16 RenderSourceName() OVERRIDE; |
48 | 50 |
49 protected: | 51 protected: |
50 explicit PrintViewManagerBase(content::WebContents* web_contents); | 52 explicit PrintViewManagerBase(content::WebContents* web_contents); |
51 | 53 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 BooleanPrefMember printing_enabled_; | 172 BooleanPrefMember printing_enabled_; |
171 | 173 |
172 scoped_refptr<printing::PrintQueriesQueue> queue_; | 174 scoped_refptr<printing::PrintQueriesQueue> queue_; |
173 | 175 |
174 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); | 176 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); |
175 }; | 177 }; |
176 | 178 |
177 } // namespace printing | 179 } // namespace printing |
178 | 180 |
179 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 181 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
OLD | NEW |