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_WORKER_OWNER_H__ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__ |
6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__ | 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__ |
7 | 7 |
| 8 #include "base/ref_counted.h" |
8 #include "printing/printing_context.h" | 9 #include "printing/printing_context.h" |
9 | 10 |
10 class MessageLoop; | 11 class MessageLoop; |
11 | 12 |
12 namespace printing { | 13 namespace printing { |
13 | 14 |
14 class PrintJobWorker; | 15 class PrintJobWorker; |
15 class PrintSettings; | 16 class PrintSettings; |
16 | 17 |
17 class PrintJobWorkerOwner { | 18 class PrintJobWorkerOwner : |
| 19 public base::RefCountedThreadSafe<PrintJobWorkerOwner> { |
18 public: | 20 public: |
19 virtual ~PrintJobWorkerOwner() { | 21 virtual ~PrintJobWorkerOwner() { |
20 } | 22 } |
21 virtual void AddRef() = 0; | |
22 virtual void Release() = 0; | |
23 | 23 |
24 // Finishes the initialization began by PrintJobWorker::Init(). Creates a | 24 // Finishes the initialization began by PrintJobWorker::Init(). Creates a |
25 // new PrintedDocument if necessary. Solely meant to be called by | 25 // new PrintedDocument if necessary. Solely meant to be called by |
26 // PrintJobWorker. | 26 // PrintJobWorker. |
27 virtual void GetSettingsDone(const PrintSettings& new_settings, | 27 virtual void GetSettingsDone(const PrintSettings& new_settings, |
28 PrintingContext::Result result) = 0; | 28 PrintingContext::Result result) = 0; |
29 | 29 |
30 // Detach the PrintJobWorker associated to this object. | 30 // Detach the PrintJobWorker associated to this object. |
31 virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) = 0; | 31 virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) = 0; |
32 | 32 |
33 // Retrieves the message loop that is expected to process GetSettingsDone. | 33 // Retrieves the message loop that is expected to process GetSettingsDone. |
34 virtual MessageLoop* message_loop() = 0; | 34 virtual MessageLoop* message_loop() = 0; |
35 | 35 |
36 // Access the current settings. | 36 // Access the current settings. |
37 virtual const PrintSettings& settings() const = 0; | 37 virtual const PrintSettings& settings() const = 0; |
38 | 38 |
39 // Cookie uniquely identifying the PrintedDocument and/or loaded settings. | 39 // Cookie uniquely identifying the PrintedDocument and/or loaded settings. |
40 virtual int cookie() const = 0; | 40 virtual int cookie() const = 0; |
41 }; | 41 }; |
42 | 42 |
43 } // namespace printing | 43 } // namespace printing |
44 | 44 |
45 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__ | 45 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__ |
OLD | NEW |