OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CHROMEOS_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ |
6 #define PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ | 6 #define PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 17 matching lines...) Expand all Loading... |
28 // PrintingContext implementation. | 28 // PrintingContext implementation. |
29 void AskUserForSettings(int max_pages, | 29 void AskUserForSettings(int max_pages, |
30 bool has_selection, | 30 bool has_selection, |
31 bool is_scripted, | 31 bool is_scripted, |
32 const PrintSettingsCallback& callback) override; | 32 const PrintSettingsCallback& callback) override; |
33 Result UseDefaultSettings() override; | 33 Result UseDefaultSettings() override; |
34 gfx::Size GetPdfPaperSizeDeviceUnits() override; | 34 gfx::Size GetPdfPaperSizeDeviceUnits() override; |
35 Result UpdatePrinterSettings(bool external_preview, | 35 Result UpdatePrinterSettings(bool external_preview, |
36 bool show_system_dialog, | 36 bool show_system_dialog, |
37 int page_count) override; | 37 int page_count) override; |
38 Result InitWithSettings(const PrintSettings& settings) override; | |
39 Result NewDocument(const base::string16& document_name) override; | 38 Result NewDocument(const base::string16& document_name) override; |
40 Result NewPage() override; | 39 Result NewPage() override; |
41 Result PageDone() override; | 40 Result PageDone() override; |
42 Result DocumentDone() override; | 41 Result DocumentDone() override; |
43 void Cancel() override; | 42 void Cancel() override; |
44 void ReleaseContext() override; | 43 void ReleaseContext() override; |
45 gfx::NativeDrawingContext context() const override; | 44 gfx::NativeDrawingContext context() const override; |
46 | 45 |
47 Result StreamData(const std::vector<char>& buffer); | 46 Result StreamData(const std::vector<char>& buffer); |
48 | 47 |
49 private: | 48 private: |
50 // Lazily initializes |printer_|. | 49 // Lazily initializes |printer_|. |
51 Result InitializeDevice(const std::string& device); | 50 Result InitializeDevice(const std::string& device); |
52 | 51 |
53 // id for ongoing print job. 0 if no job is active. | 52 // id for ongoing print job. 0 if no job is active. |
54 int job_id_; | 53 int job_id_; |
55 | 54 |
56 CupsConnection connection_; | 55 CupsConnection connection_; |
57 std::unique_ptr<CupsPrinter> printer_; | 56 std::unique_ptr<CupsPrinter> printer_; |
58 | 57 |
59 DISALLOW_COPY_AND_ASSIGN(PrintingContextChromeos); | 58 DISALLOW_COPY_AND_ASSIGN(PrintingContextChromeos); |
60 }; | 59 }; |
61 | 60 |
62 } // namespace printing | 61 } // namespace printing |
63 | 62 |
64 #endif // PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ | 63 #endif // PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ |
OLD | NEW |