tbarzic | 1378bc3 | 2015-02-25 21:41:22 | [diff] [blame] | 1 | // Copyright 2015 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. |
| 4 | |
| 5 | #ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_ |
| 6 | #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
tbarzic | 1378bc3 | 2015-02-25 21:41:22 | [diff] [blame] | 10 | #include "base/memory/ref_counted.h" |
| 11 | #include "base/memory/ref_counted_memory.h" |
tbarzic | 170b95c | 2015-03-26 00:05:26 | [diff] [blame] | 12 | #include "base/strings/string16.h" |
Vladislav Kuzkokov | 89356b64 | 2019-01-29 19:51:35 | [diff] [blame] | 13 | #include "base/values.h" |
tbarzic | 1378bc3 | 2015-02-25 21:41:22 | [diff] [blame] | 14 | |
| 15 | namespace extensions { |
| 16 | |
| 17 | // Struct describing print job that should be forwarded to an extension via |
| 18 | // chrome.printerProvider.onPrintRequested event. |
Lei Zhang | 64161dd | 2018-04-27 00:24:06 | [diff] [blame] | 19 | // TODO(tbarzic): This should probably be a class and have some methods. |
tbarzic | 1378bc3 | 2015-02-25 21:41:22 | [diff] [blame] | 20 | struct PrinterProviderPrintJob { |
| 21 | PrinterProviderPrintJob(); |
Vladislav Kuzkokov | 89356b64 | 2019-01-29 19:51:35 | [diff] [blame] | 22 | PrinterProviderPrintJob(PrinterProviderPrintJob&& other); |
| 23 | PrinterProviderPrintJob& operator=(PrinterProviderPrintJob&& other); |
tbarzic | 1378bc3 | 2015-02-25 21:41:22 | [diff] [blame] | 24 | ~PrinterProviderPrintJob(); |
| 25 | |
| 26 | // The id of the printer that should handle the print job. The id is |
| 27 | // formatted as <extension_id>:<printer_id>, where <extension_id> is the |
| 28 | // id of the extension that manages the printer, and <printer_id> is |
| 29 | // the the printer's id within the extension (as reported via |
| 30 | // chrome.printerProvider.onGetPrintersRequested event callback). |
| 31 | std::string printer_id; |
| 32 | |
tbarzic | 170b95c | 2015-03-26 00:05:26 | [diff] [blame] | 33 | // The print job title. |
Jan Wilken Dörrie | 85285b0 | 2021-03-11 23:38:47 | [diff] [blame^] | 34 | std::u16string job_title; |
tbarzic | 170b95c | 2015-03-26 00:05:26 | [diff] [blame] | 35 | |
tbarzic | 1378bc3 | 2015-02-25 21:41:22 | [diff] [blame] | 36 | // The print job ticket. |
Vladislav Kuzkokov | 89356b64 | 2019-01-29 19:51:35 | [diff] [blame] | 37 | base::Value ticket; |
tbarzic | 1378bc3 | 2015-02-25 21:41:22 | [diff] [blame] | 38 | |
| 39 | // Content type of the document that should be printed. |
| 40 | std::string content_type; |
| 41 | |
Lei Zhang | 64161dd | 2018-04-27 00:24:06 | [diff] [blame] | 42 | // The document data that should be printed. |
tbarzic | 1378bc3 | 2015-02-25 21:41:22 | [diff] [blame] | 43 | scoped_refptr<base::RefCountedMemory> document_bytes; |
Vladislav Kuzkokov | 89356b64 | 2019-01-29 19:51:35 | [diff] [blame] | 44 | |
| 45 | private: |
| 46 | DISALLOW_COPY_AND_ASSIGN(PrinterProviderPrintJob); |
tbarzic | 1378bc3 | 2015-02-25 21:41:22 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | } // namespace extensions |
| 50 | |
| 51 | #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_ |