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