OLD | NEW |
1 // Copyright (c) 2011 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 PRINTING_PRINTING_CONTEXT_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_H_ |
6 #define PRINTING_PRINTING_CONTEXT_H_ | 6 #define PRINTING_PRINTING_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 class Delegate { | 29 class Delegate { |
30 public: | 30 public: |
31 Delegate() {}; | 31 Delegate() {}; |
32 virtual ~Delegate() {}; | 32 virtual ~Delegate() {}; |
33 | 33 |
34 // Returns parent view to use for modal dialogs. | 34 // Returns parent view to use for modal dialogs. |
35 virtual gfx::NativeView GetParentView() = 0; | 35 virtual gfx::NativeView GetParentView() = 0; |
36 | 36 |
37 // Returns application locale. | 37 // Returns application locale. |
38 virtual std::string GetAppLocale() = 0; | 38 virtual std::string GetAppLocale() = 0; |
| 39 |
| 40 // TODO Doc |
| 41 virtual void SetPendingPrint() = 0; |
39 }; | 42 }; |
40 | 43 |
41 // Tri-state result for user behavior-dependent functions. | 44 // Tri-state result for user behavior-dependent functions. |
42 enum Result { | 45 enum Result { |
43 OK, | 46 OK, |
44 CANCEL, | 47 CANCEL, |
45 FAILED, | 48 FAILED, |
| 49 SYSTEM_DIALOG_DONE, |
46 }; | 50 }; |
47 | 51 |
48 virtual ~PrintingContext(); | 52 virtual ~PrintingContext(); |
49 | 53 |
50 // Callback of AskUserForSettings, used to notify the PrintJobWorker when | 54 // Callback of AskUserForSettings, used to notify the PrintJobWorker when |
51 // print settings are available. | 55 // print settings are available. |
52 typedef base::Callback<void(Result)> PrintSettingsCallback; | 56 typedef base::Callback<void(Result)> PrintSettingsCallback; |
53 | 57 |
| 58 // TODO DGN doc |
| 59 virtual void RequestSystemDialog(const PrintSettingsCallback& cb) = 0; |
| 60 |
54 // Asks the user what printer and format should be used to print. Updates the | 61 // Asks the user what printer and format should be used to print. Updates the |
55 // context with the select device settings. The result of the call is returned | 62 // context with the select device settings. The result of the call is returned |
56 // in the callback. This is necessary for Linux, which only has an | 63 // in the callback. This is necessary for Linux, which only has an |
57 // asynchronous printing API. | 64 // asynchronous printing API. |
58 virtual void AskUserForSettings(int max_pages, | 65 virtual void AskUserForSettings(int max_pages, |
59 bool has_selection, | 66 bool has_selection, |
60 const PrintSettingsCallback& callback) = 0; | 67 const PrintSettingsCallback& callback) = 0; |
61 | 68 |
62 // Selects the user's default printer and format. Updates the context with the | 69 // Selects the user's default printer and format. Updates the context with the |
63 // default device settings. | 70 // default device settings. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // Did the user cancel the print job. | 151 // Did the user cancel the print job. |
145 volatile bool abort_printing_; | 152 volatile bool abort_printing_; |
146 | 153 |
147 private: | 154 private: |
148 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 155 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
149 }; | 156 }; |
150 | 157 |
151 } // namespace printing | 158 } // namespace printing |
152 | 159 |
153 #endif // PRINTING_PRINTING_CONTEXT_H_ | 160 #endif // PRINTING_PRINTING_CONTEXT_H_ |
OLD | NEW |