| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 virtual ~PrintingContext(); | 48 virtual ~PrintingContext(); |
| 49 | 49 |
| 50 // Callback of AskUserForSettings, used to notify the PrintJobWorker when | 50 // Callback of AskUserForSettings, used to notify the PrintJobWorker when |
| 51 // print settings are available. | 51 // print settings are available. |
| 52 typedef base::Callback<void(Result)> PrintSettingsCallback; | 52 typedef base::Callback<void(Result)> PrintSettingsCallback; |
| 53 | 53 |
| 54 // Asks the user what printer and format should be used to print. Updates the | 54 // 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 | 55 // 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 | 56 // in the callback. This is necessary for Linux, which only has an |
| 57 // asynchronous printing API. | 57 // asynchronous printing API. |
| 58 // On Android, when |is_scripted| is true, calling it initiates a full |
| 59 // printing flow from the framework's PrintManager. |
| 60 // (see https://codereview.chromium.org/740983002/) |
| 58 virtual void AskUserForSettings(int max_pages, | 61 virtual void AskUserForSettings(int max_pages, |
| 59 bool has_selection, | 62 bool has_selection, |
| 63 bool is_scripted, |
| 60 const PrintSettingsCallback& callback) = 0; | 64 const PrintSettingsCallback& callback) = 0; |
| 61 | 65 |
| 62 // Selects the user's default printer and format. Updates the context with the | 66 // Selects the user's default printer and format. Updates the context with the |
| 63 // default device settings. | 67 // default device settings. |
| 64 virtual Result UseDefaultSettings() = 0; | 68 virtual Result UseDefaultSettings() = 0; |
| 65 | 69 |
| 66 // Updates the context with PDF printer settings. | 70 // Updates the context with PDF printer settings. |
| 67 Result UsePdfSettings(); | 71 Result UsePdfSettings(); |
| 68 | 72 |
| 69 // Returns paper size to be used for PDF or Cloud Print in device units. | 73 // Returns paper size to be used for PDF or Cloud Print in device units. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Did the user cancel the print job. | 148 // Did the user cancel the print job. |
| 145 volatile bool abort_printing_; | 149 volatile bool abort_printing_; |
| 146 | 150 |
| 147 private: | 151 private: |
| 148 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 152 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
| 149 }; | 153 }; |
| 150 | 154 |
| 151 } // namespace printing | 155 } // namespace printing |
| 152 | 156 |
| 153 #endif // PRINTING_PRINTING_CONTEXT_H_ | 157 #endif // PRINTING_PRINTING_CONTEXT_H_ |
| OLD | NEW |