OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 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_PRINTER_QUERY_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ |
6 #define CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "chrome/browser/printing/print_job_worker_owner.h" | 10 #include "chrome/browser/printing/print_job_worker_owner.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 | 12 |
13 class CancelableTask; | 13 class CancelableTask; |
14 class DictionaryValue; | |
14 class MessageLoop; | 15 class MessageLoop; |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class Thread; | 18 class Thread; |
18 } | 19 } |
19 | 20 |
20 namespace printing { | 21 namespace printing { |
21 | 22 |
22 class PrintJobWorker; | 23 class PrintJobWorker; |
23 | 24 |
(...skipping 20 matching lines...) Expand all Loading... | |
44 // times to reinitialize the settings. |parent_view| parameter's window will | 45 // times to reinitialize the settings. |parent_view| parameter's window will |
45 // be the owner of the print setting dialog box. It is unused when | 46 // be the owner of the print setting dialog box. It is unused when |
46 // |ask_for_user_settings| is DEFAULTS. | 47 // |ask_for_user_settings| is DEFAULTS. |
47 void GetSettings(GetSettingsAskParam ask_user_for_settings, | 48 void GetSettings(GetSettingsAskParam ask_user_for_settings, |
48 gfx::NativeView parent_view, | 49 gfx::NativeView parent_view, |
49 int expected_page_count, | 50 int expected_page_count, |
50 bool has_selection, | 51 bool has_selection, |
51 bool use_overlays, | 52 bool use_overlays, |
52 CancelableTask* callback); | 53 CancelableTask* callback); |
53 | 54 |
55 // Updates the current settings with |new_settings| dictionary values. | |
56 void SetSettings(const DictionaryValue& new_settings, | |
57 CancelableTask* callback); | |
58 | |
59 // Lazy create the worker thread. There is one worker thread per print job. | |
60 // Returns true, if worker thread exists or created. | |
Lei Zhang
2011/03/03 00:22:44
nit: or has been created.
kmadhusu
2011/03/04 19:39:02
Done.
| |
61 bool StartWorker(CancelableTask* callback); | |
Lei Zhang
2011/03/03 00:22:44
This method should be private.
kmadhusu
2011/03/04 19:39:02
Done.
| |
62 | |
54 // Stops the worker thread since the client is done with this object. | 63 // Stops the worker thread since the client is done with this object. |
55 void StopWorker(); | 64 void StopWorker(); |
56 | 65 |
57 // Returns true if a GetSettings() call is pending completion. | 66 // Returns true if a GetSettings() call is pending completion. |
58 bool is_callback_pending() const; | 67 bool is_callback_pending() const; |
59 | 68 |
60 PrintingContext::Result last_status() const { return last_status_; } | 69 PrintingContext::Result last_status() const { return last_status_; } |
61 | 70 |
62 // Returns if a worker thread is still associated to this instance. | 71 // Returns if a worker thread is still associated to this instance. |
63 bool is_valid() const; | 72 bool is_valid() const; |
(...skipping 24 matching lines...) Expand all Loading... | |
88 | 97 |
89 // Task waiting to be executed. | 98 // Task waiting to be executed. |
90 scoped_ptr<CancelableTask> callback_; | 99 scoped_ptr<CancelableTask> callback_; |
91 | 100 |
92 DISALLOW_COPY_AND_ASSIGN(PrinterQuery); | 101 DISALLOW_COPY_AND_ASSIGN(PrinterQuery); |
93 }; | 102 }; |
94 | 103 |
95 } // namespace printing | 104 } // namespace printing |
96 | 105 |
97 #endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ | 106 #endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ |
OLD | NEW |