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" |
11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
13 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
14 #include "content/public/browser/web_contents_user_data.h" | 14 #include "content/public/browser/web_contents_user_data.h" |
15 #include "printing/printed_pages_source.h" | 15 #include "printing/printed_pages_source.h" |
16 | 16 |
17 struct PrintHostMsg_DidPrintPage_Params; | 17 struct PrintHostMsg_DidPrintPage_Params; |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class RenderViewHost; | 20 class RenderViewHost; |
21 } | 21 } |
22 | 22 |
23 namespace printing { | 23 namespace printing { |
24 | 24 |
25 class JobEventDetails; | 25 class JobEventDetails; |
26 class Metafile; | 26 class MetafilePlayer; |
27 class PdfToEmfConverter; | 27 class PdfToEmfConverter; |
28 class PrintJob; | 28 class PrintJob; |
29 class PrintJobWorkerOwner; | 29 class PrintJobWorkerOwner; |
30 class PrintQueriesQueue; | 30 class PrintQueriesQueue; |
31 | 31 |
32 // Base class for managing the print commands for a WebContents. | 32 // Base class for managing the print commands for a WebContents. |
33 class PrintViewManagerBase : public content::NotificationObserver, | 33 class PrintViewManagerBase : public content::NotificationObserver, |
34 public PrintedPagesSource, | 34 public PrintedPagesSource, |
35 public content::WebContentsObserver { | 35 public content::WebContentsObserver { |
36 public: | 36 public: |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // print_job_ is initialized. | 131 // print_job_ is initialized. |
132 bool OpportunisticallyCreatePrintJob(int cookie); | 132 bool OpportunisticallyCreatePrintJob(int cookie); |
133 | 133 |
134 // Release the PrinterQuery associated with our |cookie_|. | 134 // Release the PrinterQuery associated with our |cookie_|. |
135 void ReleasePrinterQuery(); | 135 void ReleasePrinterQuery(); |
136 | 136 |
137 #if defined(OS_WIN) | 137 #if defined(OS_WIN) |
138 // Called on completion of converting the pdf to emf. | 138 // Called on completion of converting the pdf to emf. |
139 void OnPdfToEmfConverted(const PrintHostMsg_DidPrintPage_Params& params, | 139 void OnPdfToEmfConverted(const PrintHostMsg_DidPrintPage_Params& params, |
140 double scale_factor, | 140 double scale_factor, |
141 ScopedVector<Metafile>* emf_files); | 141 ScopedVector<MetafilePlayer>* emf_files); |
142 #endif // OS_WIN | 142 #endif // OS_WIN |
143 | 143 |
144 content::NotificationRegistrar registrar_; | 144 content::NotificationRegistrar registrar_; |
145 | 145 |
146 // Manages the low-level talk to the printer. | 146 // Manages the low-level talk to the printer. |
147 scoped_refptr<PrintJob> print_job_; | 147 scoped_refptr<PrintJob> print_job_; |
148 | 148 |
149 // Number of pages to print in the print job. | 149 // Number of pages to print in the print job. |
150 int number_pages_; | 150 int number_pages_; |
151 | 151 |
(...skipping 21 matching lines...) Expand all Loading... |
173 BooleanPrefMember printing_enabled_; | 173 BooleanPrefMember printing_enabled_; |
174 | 174 |
175 scoped_refptr<printing::PrintQueriesQueue> queue_; | 175 scoped_refptr<printing::PrintQueriesQueue> queue_; |
176 | 176 |
177 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); | 177 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); |
178 }; | 178 }; |
179 | 179 |
180 } // namespace printing | 180 } // namespace printing |
181 | 181 |
182 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 182 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
OLD | NEW |