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

Side by Side Diff: chromeos/printing/printer_configuration.h

Issue 2903113002: Track printer protocol usage for CUPS printers. (Closed)
Patch Set: rename to Printing.CUPS.ProtocolUsed Created 3 years, 7 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ 5 #ifndef CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_
6 #define CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ 6 #define CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 29 matching lines...) Expand all
40 // True if the printer should be auto-configured and a PPD is unnecessary. 40 // True if the printer should be auto-configured and a PPD is unnecessary.
41 bool autoconf = false; 41 bool autoconf = false;
42 }; 42 };
43 43
44 // The location where the printer is stored. 44 // The location where the printer is stored.
45 enum Source { 45 enum Source {
46 SRC_USER_PREFS, 46 SRC_USER_PREFS,
47 SRC_POLICY, 47 SRC_POLICY,
48 }; 48 };
49 49
50 // An enumeration of printer protocols. Do not change these values as they
51 // are used in enums.xml.
52 enum PrinterProtocol {
53 UNKOWN = 0,
Lei Zhang 2017/05/25 19:02:29 Typo
Lei Zhang 2017/05/25 19:02:29 Can we start using kFoo? https://bugs.chromium.org
skau 2017/05/25 19:35:48 Done.
skau 2017/05/25 19:35:48 Done.
54 USB = 1,
55 IPP = 2,
56 IPPS = 3,
57 HTTP = 4,
58 HTTPS = 5,
59 SOCKET = 6,
60 LPD = 7,
61 PROTOCOL_MAX
62 };
63
50 // Constructs a printer object that is completely empty. 64 // Constructs a printer object that is completely empty.
51 Printer(); 65 Printer();
52 66
53 // Constructs a printer object with an |id| and a |last_updated| timestamp. 67 // Constructs a printer object with an |id| and a |last_updated| timestamp.
54 explicit Printer(const std::string& id, const base::Time& last_updated = {}); 68 explicit Printer(const std::string& id, const base::Time& last_updated = {});
55 69
56 // Copy constructor and assignment. 70 // Copy constructor and assignment.
57 Printer(const Printer& printer); 71 Printer(const Printer& printer);
58 Printer& operator=(const Printer& printer); 72 Printer& operator=(const Printer& printer);
59 73
(...skipping 27 matching lines...) Expand all
87 PpdReference* mutable_ppd_reference() { return &ppd_reference_; } 101 PpdReference* mutable_ppd_reference() { return &ppd_reference_; }
88 102
89 const std::string& uuid() const { return uuid_; } 103 const std::string& uuid() const { return uuid_; }
90 void set_uuid(const std::string& uuid) { uuid_ = uuid; } 104 void set_uuid(const std::string& uuid) { uuid_ = uuid; }
91 105
92 // Returns true if the printer should be automatically configured using 106 // Returns true if the printer should be automatically configured using
93 // IPP Everywhere. Computed using information from |ppd_reference_| and 107 // IPP Everywhere. Computed using information from |ppd_reference_| and
94 // |uri_|. 108 // |uri_|.
95 bool IsIppEverywhere() const; 109 bool IsIppEverywhere() const;
96 110
111 // Returns the printer protocol the printer is configured with.
112 Printer::PrinterProtocol GetProtocol() const;
113
97 Source source() const { return source_; } 114 Source source() const { return source_; }
98 void set_source(const Source source) { source_ = source; } 115 void set_source(const Source source) { source_ = source; }
99 116
100 // Returns the timestamp for the most recent update. Returns 0 if the 117 // Returns the timestamp for the most recent update. Returns 0 if the
101 // printer was not created with a valid timestamp. 118 // printer was not created with a valid timestamp.
102 base::Time last_updated() const { return last_updated_; } 119 base::Time last_updated() const { return last_updated_; }
103 120
104 private: 121 private:
105 // Globally unique identifier. Empty indicates a new printer. 122 // Globally unique identifier. Empty indicates a new printer.
106 std::string id_; 123 std::string id_;
(...skipping 23 matching lines...) Expand all
130 // The datastore which holds this printer. 147 // The datastore which holds this printer.
131 Source source_; 148 Source source_;
132 149
133 // Timestamp of most recent change. 150 // Timestamp of most recent change.
134 base::Time last_updated_; 151 base::Time last_updated_;
135 }; 152 };
136 153
137 } // namespace chromeos 154 } // namespace chromeos
138 155
139 #endif // CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ 156 #endif // CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview/printer_backend_proxy_chromeos.cc ('k') | chromeos/printing/printer_configuration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698