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

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: lint 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 57%
copy from printing/printing_context_no_system_dialog.h
copy to printing/printing_context_chromeos.h
index 79a0ddfa54db6e961f66ca9d532d21aaa6f33786..a5883cb99cecaf06b88db8279d818bf9f2b00536 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. -1 if no job is active.
Lei Zhang 2016/07/25 21:06:04 printing_context_chromeos.cc checks for 0, what is
skau 2016/07/27 00:16:47 If the createDestJob fails, job_id is set to 0. I
+ 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