OLD | NEW |
---|---|
1 // Copyright (c) 2011 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_NO_SYSTEM_DIALOG_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ |
6 #define PRINTING_PRINTING_CONTEXT_NO_SYSTEM_DIALOG_H_ | 6 #define PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ |
7 | 7 |
8 #include <memory> | |
8 #include <string> | 9 #include <string> |
10 #include <vector> | |
9 | 11 |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "printing/backend/cups_connection.h" | |
14 #include "printing/backend/cups_printer.h" | |
15 #include "printing/backend/print_backend.h" | |
Lei Zhang
2016/07/20 01:26:57
is this needed here?
skau
2016/07/22 23:36:14
Done.
| |
11 #include "printing/printing_context.h" | 16 #include "printing/printing_context.h" |
12 | 17 |
13 namespace base { | 18 namespace base { |
14 class DictionaryValue; | 19 class DictionaryValue; |
15 } | 20 } |
16 | 21 |
17 namespace printing { | 22 namespace printing { |
18 | 23 |
19 class PRINTING_EXPORT PrintingContextNoSystemDialog : public PrintingContext { | 24 class PRINTING_EXPORT PrintingContextChromeos : public PrintingContext { |
20 public: | 25 public: |
21 explicit PrintingContextNoSystemDialog(Delegate* delegate); | 26 explicit PrintingContextChromeos(Delegate* delegate); |
22 ~PrintingContextNoSystemDialog() override; | 27 ~PrintingContextChromeos() override; |
23 | 28 |
24 // PrintingContext implementation. | 29 // PrintingContext implementation. |
25 void AskUserForSettings(int max_pages, | 30 void AskUserForSettings(int max_pages, |
26 bool has_selection, | 31 bool has_selection, |
27 bool is_scripted, | 32 bool is_scripted, |
28 const PrintSettingsCallback& callback) override; | 33 const PrintSettingsCallback& callback) override; |
29 Result UseDefaultSettings() override; | 34 Result UseDefaultSettings() override; |
30 gfx::Size GetPdfPaperSizeDeviceUnits() override; | 35 gfx::Size GetPdfPaperSizeDeviceUnits() override; |
31 Result UpdatePrinterSettings(bool external_preview, | 36 Result UpdatePrinterSettings(bool external_preview, |
32 bool show_system_dialog, | 37 bool show_system_dialog, |
33 int page_count) override; | 38 int page_count) override; |
34 Result InitWithSettings(const PrintSettings& settings) override; | 39 Result InitWithSettings(const PrintSettings& settings) override; |
40 | |
41 Result StreamData(const std::vector<char>& buffer); | |
Lei Zhang
2016/07/20 01:26:57
Don't squeeze this into the middle of a list of ov
skau
2016/07/22 23:36:14
Done.
| |
42 | |
35 Result NewDocument(const base::string16& document_name) override; | 43 Result NewDocument(const base::string16& document_name) override; |
36 Result NewPage() override; | 44 Result NewPage() override; |
37 Result PageDone() override; | 45 Result PageDone() override; |
38 Result DocumentDone() override; | 46 Result DocumentDone() override; |
39 void Cancel() override; | 47 void Cancel() override; |
40 void ReleaseContext() override; | 48 void ReleaseContext() override; |
41 gfx::NativeDrawingContext context() const override; | 49 gfx::NativeDrawingContext context() const override; |
42 | 50 |
43 private: | 51 private: |
44 DISALLOW_COPY_AND_ASSIGN(PrintingContextNoSystemDialog); | 52 // Lazily initializes |printer_|. |
53 Result InitializeDevice(const std::string& device); | |
54 | |
55 // id for ongoing print job. -1 if no job is active. | |
56 int job_id_; | |
57 | |
58 CupsConnection connection_; | |
59 std::unique_ptr<CupsPrinter> printer_; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(PrintingContextChromeos); | |
45 }; | 62 }; |
46 | 63 |
47 } // namespace printing | 64 } // namespace printing |
48 | 65 |
49 #endif // PRINTING_PRINTING_CONTEXT_NO_SYSTEM_DIALOG_H_ | 66 #endif // PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ |
OLD | NEW |