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

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: format and merge 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
« no previous file with comments | « printing/printing.gyp ('k') | printing/printing_context_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « printing/printing.gyp ('k') | printing/printing_context_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698