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

Side by Side Diff: printing/backend/cups_connection.h

Issue 2105463002: Create a new print backend for the updated CUPS APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typos 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PRINTING_BACKEND_CUPS_CONNECTION_H_
6 #define PRINTING_BACKEND_CUPS_CONNECTION_H_
7
8 #include <cups/cups.h>
9
10 #include <memory>
11 #include <string>
12 #include <vector>
13
14 #include "printing/backend/cups_printer.h"
15 #include "printing/printing_export.h"
16 #include "url/gurl.h"
17
18 namespace printing {
19
20 // Represents a connection to a CUPS server.
21 class PRINTING_EXPORT CupsConnection {
22 public:
23 explicit CupsConnection(const GURL& print_server_url,
24 http_encryption_t encryption,
25 bool blocking);
26
27 CupsConnection(const CupsConnection& connection);
28
29 ~CupsConnection();
30
31 // Returns the number of destinations and populates |destinations|.
32 std::vector<CupsPrinter> GetDests();
33
34 // Returns a printer for |printer_name| from the connected server.
35 CupsPrinter* GetPrinter(const std::string& printer_name);
36
37 std::string server_name() const;
38
39 int last_error() const;
40
41 private:
42 // lazily initialize http connection
43 bool Connect();
44
45 GURL print_server_url_;
46 http_encryption_t cups_encryption_;
47 bool blocking_;
48
49 std::shared_ptr<http_t> cups_http_;
Lei Zhang 2016/07/08 01:19:50 Currently banned: https://chromium-cpp.appspot.com
skau 2016/07/08 21:24:08 I've switched to a WeakPtr implementation. Lmk wh
50 };
51
52 } // namespace printing
53
54 #endif // PRINTING_BACKEND_CUPS_CONNECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698