OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_JOB_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ |
6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // Pops a queued PrintJobWorkerOwner object that was previously queued. Can be | 36 // Pops a queued PrintJobWorkerOwner object that was previously queued. Can be |
37 // called from any thread. Current use case is poping from the browser thread. | 37 // called from any thread. Current use case is poping from the browser thread. |
38 void PopPrinterQuery(int document_cookie, scoped_refptr<PrinterQuery>* job); | 38 void PopPrinterQuery(int document_cookie, scoped_refptr<PrinterQuery>* job); |
39 | 39 |
40 // NotificationObserver | 40 // NotificationObserver |
41 virtual void Observe(NotificationType type, | 41 virtual void Observe(NotificationType type, |
42 const NotificationSource& source, | 42 const NotificationSource& source, |
43 const NotificationDetails& details); | 43 const NotificationDetails& details); |
44 | 44 |
45 // Sets a path where to dump EMF data files. This enables debug behavior where | |
46 // every rendered pages are dumped as-is. By default the path is empty, which | |
47 // disables the dumping. | |
48 // TODO(maruel): Remove me once printing is awesome. | |
49 void set_debug_dump_path(const std::wstring& debug_dump_path) { | |
50 debug_dump_path_ = debug_dump_path; | |
51 } | |
52 | |
53 const std::wstring& debug_dump_path() const { | |
54 return debug_dump_path_; | |
55 } | |
56 | |
57 private: | 45 private: |
58 typedef std::vector<scoped_refptr<PrintJob> > PrintJobs; | 46 typedef std::vector<scoped_refptr<PrintJob> > PrintJobs; |
59 typedef std::vector<scoped_refptr<PrinterQuery> > PrinterQueries; | 47 typedef std::vector<scoped_refptr<PrinterQuery> > PrinterQueries; |
60 | 48 |
61 // Processes a NOTIFY_PRINT_JOB_EVENT notification. | 49 // Processes a NOTIFY_PRINT_JOB_EVENT notification. |
62 void OnPrintJobEvent(PrintJob* print_job, | 50 void OnPrintJobEvent(PrintJob* print_job, |
63 const JobEventDetails& event_details); | 51 const JobEventDetails& event_details); |
64 | 52 |
65 // Processes a NOTIFY_PRINTED_DOCUMENT_UPDATED notification. When | |
66 // debug_dump_path_ is not empty, it is processed to detect newly rendered | |
67 // pages and to dump their EMF buffer. | |
68 void OnPrintedDocumentUpdated(const PrintedDocument& document, | |
69 const PrintedPage& page); | |
70 | |
71 NotificationRegistrar registrar_; | 53 NotificationRegistrar registrar_; |
72 | 54 |
73 // Used to serialize access to queued_workers_. | 55 // Used to serialize access to queued_workers_. |
74 Lock lock_; | 56 Lock lock_; |
75 | 57 |
76 PrinterQueries queued_queries_; | 58 PrinterQueries queued_queries_; |
77 | 59 |
78 // Current print jobs that are active. | 60 // Current print jobs that are active. |
79 PrintJobs current_jobs_; | 61 PrintJobs current_jobs_; |
80 | 62 |
81 // Path where debug dump of EMF buffer are saved. Empty by default. When | |
82 // empty, EMF dumping is disabled. | |
83 // TODO(maruel): Remove me once printing is awesome. | |
84 std::wstring debug_dump_path_; | |
85 | |
86 DISALLOW_EVIL_CONSTRUCTORS(PrintJobManager); | 63 DISALLOW_EVIL_CONSTRUCTORS(PrintJobManager); |
87 }; | 64 }; |
88 | 65 |
89 } // namespace printing | 66 } // namespace printing |
90 | 67 |
91 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ | 68 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ |
OLD | NEW |