1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__
6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__
8 #include "base/memory/ref_counted.h"
9 #include "printing/printing_context.h"
21 class PrintJobWorkerOwner
22 : public base::RefCountedThreadSafe
<PrintJobWorkerOwner
> {
24 // Finishes the initialization began by PrintJobWorker::GetSettings().
25 // Creates a new PrintedDocument if necessary. Solely meant to be called by
27 virtual void GetSettingsDone(const PrintSettings
& new_settings
,
28 PrintingContext::Result result
) = 0;
30 // Detach the PrintJobWorker associated to this object.
31 virtual PrintJobWorker
* DetachWorker(PrintJobWorkerOwner
* new_owner
) = 0;
33 // Retrieves the message loop that is expected to process GetSettingsDone.
34 virtual base::MessageLoop
* message_loop() = 0;
36 // Access the current settings.
37 virtual const PrintSettings
& settings() const = 0;
39 // Cookie uniquely identifying the PrintedDocument and/or loaded settings.
40 virtual int cookie() const = 0;
43 friend class base::RefCountedThreadSafe
<PrintJobWorkerOwner
>;
45 virtual ~PrintJobWorkerOwner() {}
48 } // namespace printing
50 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__