OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_ |
6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_ | 6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/ref_counted_memory.h" | 13 #include "base/memory/ref_counted_memory.h" |
| 14 #include "base/strings/string16.h" |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 | 17 |
17 // Struct describing print job that should be forwarded to an extension via | 18 // Struct describing print job that should be forwarded to an extension via |
18 // chrome.printerProvider.onPrintRequested event. | 19 // chrome.printerProvider.onPrintRequested event. |
19 // TODO(tbarzic): This should probably be a class and have some methods, e.g. | 20 // TODO(tbarzic): This should probably be a class and have some methods, e.g. |
20 // whether the job is initialized and whether the data is described using a file | 21 // whether the job is initialized and whether the data is described using a file |
21 // or bytes. | 22 // or bytes. |
22 struct PrinterProviderPrintJob { | 23 struct PrinterProviderPrintJob { |
23 PrinterProviderPrintJob(); | 24 PrinterProviderPrintJob(); |
24 ~PrinterProviderPrintJob(); | 25 ~PrinterProviderPrintJob(); |
25 | 26 |
26 // The id of the printer that should handle the print job. The id is | 27 // 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 // 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 // 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 // the the printer's id within the extension (as reported via |
30 // chrome.printerProvider.onGetPrintersRequested event callback). | 31 // chrome.printerProvider.onGetPrintersRequested event callback). |
31 std::string printer_id; | 32 std::string printer_id; |
32 | 33 |
| 34 // The print job title. |
| 35 base::string16 job_title; |
| 36 |
33 // The print job ticket. | 37 // The print job ticket. |
34 std::string ticket_json; | 38 std::string ticket_json; |
35 | 39 |
36 // Content type of the document that should be printed. | 40 // Content type of the document that should be printed. |
37 std::string content_type; | 41 std::string content_type; |
38 | 42 |
39 // The document data that should be printed. Should be NULL if document data | 43 // The document data that should be printed. Should be NULL if document data |
40 // is kept in a file. | 44 // is kept in a file. |
41 scoped_refptr<base::RefCountedMemory> document_bytes; | 45 scoped_refptr<base::RefCountedMemory> document_bytes; |
42 | 46 |
43 // Path of the file which contains data to be printed. Should be set only if | 47 // Path of the file which contains data to be printed. Should be set only if |
44 // |document_bytes| are NULL. | 48 // |document_bytes| are NULL. |
45 base::FilePath document_path; | 49 base::FilePath document_path; |
46 | 50 |
47 // Information about the file which contains data to be printed. Should be | 51 // Information about the file which contains data to be printed. Should be |
48 // set only if |document_path| is set. | 52 // set only if |document_path| is set. |
49 base::File::Info file_info; | 53 base::File::Info file_info; |
50 }; | 54 }; |
51 | 55 |
52 } // namespace extensions | 56 } // namespace extensions |
53 | 57 |
54 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_ | 58 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_ |
OLD | NEW |