Index: printing/printing_context_chromeos.h |
diff --git a/printing/printing_context_no_system_dialog.h b/printing/printing_context_chromeos.h |
similarity index 57% |
copy from printing/printing_context_no_system_dialog.h |
copy to printing/printing_context_chromeos.h |
index 79a0ddfa54db6e961f66ca9d532d21aaa6f33786..baa4af251f4892e50b7d71f1ff27cd1bd15f076e 100644 |
--- a/printing/printing_context_no_system_dialog.h |
+++ b/printing/printing_context_chromeos.h |
@@ -1,13 +1,17 @@ |
-// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef PRINTING_PRINTING_CONTEXT_NO_SYSTEM_DIALOG_H_ |
-#define PRINTING_PRINTING_CONTEXT_NO_SYSTEM_DIALOG_H_ |
+#ifndef PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ |
+#define PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ |
+#include <memory> |
#include <string> |
+#include <vector> |
#include "base/macros.h" |
+#include "printing/backend/cups_connection.h" |
+#include "printing/backend/cups_printer.h" |
#include "printing/printing_context.h" |
namespace base { |
@@ -16,10 +20,10 @@ class DictionaryValue; |
namespace printing { |
-class PRINTING_EXPORT PrintingContextNoSystemDialog : public PrintingContext { |
+class PRINTING_EXPORT PrintingContextChromeos : public PrintingContext { |
public: |
- explicit PrintingContextNoSystemDialog(Delegate* delegate); |
- ~PrintingContextNoSystemDialog() override; |
+ explicit PrintingContextChromeos(Delegate* delegate); |
+ ~PrintingContextChromeos() override; |
// PrintingContext implementation. |
void AskUserForSettings(int max_pages, |
@@ -40,10 +44,21 @@ class PRINTING_EXPORT PrintingContextNoSystemDialog : public PrintingContext { |
void ReleaseContext() override; |
gfx::NativeDrawingContext context() const override; |
+ Result StreamData(const std::vector<char>& buffer); |
+ |
private: |
- DISALLOW_COPY_AND_ASSIGN(PrintingContextNoSystemDialog); |
+ // Lazily initializes |printer_|. |
+ Result InitializeDevice(const std::string& device); |
+ |
+ // id for ongoing print job. 0 if no job is active. |
+ int job_id_; |
+ |
+ CupsConnection connection_; |
+ std::unique_ptr<CupsPrinter> printer_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PrintingContextChromeos); |
}; |
} // namespace printing |
-#endif // PRINTING_PRINTING_CONTEXT_NO_SYSTEM_DIALOG_H_ |
+#endif // PRINTING_PRINTING_CONTEXT_CHROMEOS_H_ |