Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: printing/printing_context_chromeos.h

Issue 2117713002: Print directly to CUPS using the IPP APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ippRead
Patch Set: Update patch Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: printing/printing_context_chromeos.h
diff --git a/printing/printing_context_no_system_dialog.h b/printing/printing_context_chromeos.h
similarity index 58%
copy from printing/printing_context_no_system_dialog.h
copy to printing/printing_context_chromeos.h
index 79a0ddfa54db6e961f66ca9d532d21aaa6f33786..a88a2eed731dcebfc7097b6225f19bc0343345c3 100644
--- a/printing/printing_context_no_system_dialog.h
+++ b/printing/printing_context_chromeos.h
@@ -1,13 +1,20 @@
-// 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 <cups/cups.h>
Lei Zhang 2016/07/13 01:43:05 not needed here?
skau 2016/07/14 23:47:12 Done.
+
+#include <memory>
#include <string>
+#include <vector>
#include "base/macros.h"
+#include "printing/backend/cups_connection.h"
+#include "printing/backend/cups_printer.h"
+#include "printing/backend/print_backend.h"
#include "printing/printing_context.h"
namespace base {
@@ -16,10 +23,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,
@@ -32,6 +39,9 @@ class PRINTING_EXPORT PrintingContextNoSystemDialog : public PrintingContext {
bool show_system_dialog,
int page_count) override;
Result InitWithSettings(const PrintSettings& settings) override;
+
+ Result StreamData(char* buffer, int len);
Lei Zhang 2016/07/13 01:43:05 Can this take a vector?
skau 2016/07/14 23:47:12 Yes
+
Result NewDocument(const base::string16& document_name) override;
Result NewPage() override;
Result PageDone() override;
@@ -41,9 +51,16 @@ class PRINTING_EXPORT PrintingContextNoSystemDialog : public PrintingContext {
gfx::NativeDrawingContext context() const override;
private:
- DISALLOW_COPY_AND_ASSIGN(PrintingContextNoSystemDialog);
+ Result InitializeDevice(const std::string& device);
+
+ 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_

Powered by Google App Engine
This is Rietveld 408576698