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

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: Skip compiling the chromeos context if we don't compile against cups 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 56%
copy from printing/printing_context_no_system_dialog.h
copy to printing/printing_context_chromeos.h
index 79a0ddfa54db6e961f66ca9d532d21aaa6f33786..9ad7318f2ce76ea753b3ef5b730bb64dc2395f64 100644
--- a/printing/printing_context_no_system_dialog.h
+++ b/printing/printing_context_chromeos.h
@@ -1,13 +1,18 @@
-// 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/backend/print_backend.h"
Lei Zhang 2016/07/20 01:26:57 is this needed here?
skau 2016/07/22 23:36:14 Done.
#include "printing/printing_context.h"
namespace base {
@@ -16,10 +21,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 +37,9 @@ class PRINTING_EXPORT PrintingContextNoSystemDialog : public PrintingContext {
bool show_system_dialog,
int page_count) override;
Result InitWithSettings(const PrintSettings& settings) override;
+
+ 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.
+
Result NewDocument(const base::string16& document_name) override;
Result NewPage() override;
Result PageDone() override;
@@ -41,9 +49,18 @@ class PRINTING_EXPORT PrintingContextNoSystemDialog : public PrintingContext {
gfx::NativeDrawingContext context() const override;
private:
- DISALLOW_COPY_AND_ASSIGN(PrintingContextNoSystemDialog);
+ // Lazily initializes |printer_|.
+ Result InitializeDevice(const std::string& device);
+
+ // id for ongoing print job. -1 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_

Powered by Google App Engine
This is Rietveld 408576698