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
3 // found in the LICENSE file.
5 #ifndef PRINTING_PRINTING_CONTEXT_CHROMEOS_H_
6 #define PRINTING_PRINTING_CONTEXT_CHROMEOS_H_
12 #include "base/macros.h"
13 #include "printing/backend/cups_connection.h"
14 #include "printing/backend/cups_printer.h"
15 #include "printing/printing_context.h"
19 class PRINTING_EXPORT PrintingContextChromeos : public PrintingContext {
21 explicit PrintingContextChromeos(Delegate* delegate);
22 ~PrintingContextChromeos() override;
24 // PrintingContext implementation.
25 void AskUserForSettings(int max_pages,
28 PrintSettingsCallback callback) override;
29 Result UseDefaultSettings() override;
30 gfx::Size GetPdfPaperSizeDeviceUnits() override;
31 Result UpdatePrinterSettings(bool external_preview,
32 bool show_system_dialog,
33 int page_count) override;
34 Result NewDocument(const base::string16& document_name) override;
35 Result NewPage() override;
36 Result PageDone() override;
37 Result DocumentDone() override;
38 void Cancel() override;
39 void ReleaseContext() override;
40 printing::NativeDrawingContext context() const override;
42 Result StreamData(const std::vector<char>& buffer);
45 // Lazily initializes |printer_|.
46 Result InitializeDevice(const std::string& device);
48 CupsConnection connection_;
49 std::unique_ptr<CupsPrinter> printer_;
51 DISALLOW_COPY_AND_ASSIGN(PrintingContextChromeos);
54 } // namespace printing
56 #endif // PRINTING_PRINTING_CONTEXT_CHROMEOS_H_