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(OS_WIN) | |
39 // Prints the current document immediately. Since the rendering is | 38 // Prints the current document immediately. Since the rendering is |
40 // asynchronous, the actual printing will not be completed on the return of | 39 // asynchronous, the actual printing will not be completed on the return of |
41 // this function. Returns false if printing is impossible at the moment. | 40 // this function. Returns false if printing is impossible at the moment. |
42 virtual bool PrintNow(); | 41 virtual bool PrintNow(); |
43 #endif // !OS_WIN | |
44 | 42 |
45 // Whether to block scripted printing for our tab or not. | 43 // Whether to block scripted printing for our tab or not. |
46 void UpdateScriptedPrintingBlocked(); | 44 void UpdateScriptedPrintingBlocked(); |
47 | 45 |
48 // PrintedPagesSource implementation. | 46 // PrintedPagesSource implementation. |
49 virtual base::string16 RenderSourceName() OVERRIDE; | 47 virtual base::string16 RenderSourceName() OVERRIDE; |
50 | 48 |
51 protected: | 49 protected: |
52 explicit PrintViewManagerBase(content::WebContents* web_contents); | 50 explicit PrintViewManagerBase(content::WebContents* web_contents); |
53 | 51 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 BooleanPrefMember printing_enabled_; | 170 BooleanPrefMember printing_enabled_; |
173 | 171 |
174 scoped_refptr<printing::PrintQueriesQueue> queue_; | 172 scoped_refptr<printing::PrintQueriesQueue> queue_; |
175 | 173 |
176 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); | 174 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); |
177 }; | 175 }; |
178 | 176 |
179 } // namespace printing | 177 } // namespace printing |
180 | 178 |
181 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 179 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
OLD | NEW |