OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_H_ |
6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "chrome/browser/printing/print_job_worker_owner.h" | 12 #include "chrome/browser/printing/print_job_worker_owner.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 | 15 |
16 class Thread; | 16 class Thread; |
17 | 17 |
18 namespace printing { | 18 namespace printing { |
19 | 19 |
20 // See definition below. | 20 // See definition below. |
21 class JobEventDetails; | 21 class JobEventDetails; |
22 | 22 |
23 class PrintedDocument; | 23 class PrintedDocument; |
24 class PrintedPage; | 24 class PrintedPage; |
25 class PrintedPagesSource; | 25 class PrintedPagesSource; |
26 class PrintJobWorker; | 26 class PrintJobWorker; |
27 class PrinterQuery; | 27 class PrinterQuery; |
28 | 28 |
29 // Manages the print work for a specific document. Talks to the printer through | 29 // Manages the print work for a specific document. Talks to the printer through |
30 // PrintingContext though PrintJob::Worker. Hides access to PrintingContext in a | 30 // PrintingContext through PrintJobWorker. Hides access to PrintingContext in a |
31 // worker thread so the caller never blocks. PrintJob will send notifications on | 31 // worker thread so the caller never blocks. PrintJob will send notifications on |
32 // any state change. While printing, the PrintJobManager instance keeps a | 32 // any state change. While printing, the PrintJobManager instance keeps a |
33 // reference to the job to be sure it is kept alive. All the code in this class | 33 // reference to the job to be sure it is kept alive. All the code in this class |
34 // runs in the UI thread. | 34 // runs in the UI thread. |
35 class PrintJob : public PrintJobWorkerOwner, | 35 class PrintJob : public PrintJobWorkerOwner, |
36 public content::NotificationObserver, | 36 public content::NotificationObserver, |
37 public base::MessageLoop::DestructionObserver { | 37 public base::MessageLoop::DestructionObserver { |
38 public: | 38 public: |
39 // Create a empty PrintJob. When initializing with this constructor, | 39 // Create a empty PrintJob. When initializing with this constructor, |
40 // post-constructor initialization must be done with Initialize(). | 40 // post-constructor initialization must be done with Initialize(). |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 scoped_refptr<PrintedDocument> document_; | 217 scoped_refptr<PrintedDocument> document_; |
218 scoped_refptr<PrintedPage> page_; | 218 scoped_refptr<PrintedPage> page_; |
219 const Type type_; | 219 const Type type_; |
220 | 220 |
221 DISALLOW_COPY_AND_ASSIGN(JobEventDetails); | 221 DISALLOW_COPY_AND_ASSIGN(JobEventDetails); |
222 }; | 222 }; |
223 | 223 |
224 } // namespace printing | 224 } // namespace printing |
225 | 225 |
226 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_H_ | 226 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_H_ |
OLD | NEW |