Index: chrome/browser/chromeos/printing/printer_configuration.h |
diff --git a/chrome/browser/chromeos/printing/printer_configuration.h b/chrome/browser/chromeos/printing/printer_configuration.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..70f83a5c8dca40768f1d42598ebad10b94096d51 |
--- /dev/null |
+++ b/chrome/browser/chromeos/printing/printer_configuration.h |
@@ -0,0 +1,94 @@ |
+// 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 CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ |
+#define CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ |
+ |
+#include <string> |
+ |
+namespace chromeos { |
+ |
+// Represents a Postscript Printer Description with which the printer was setup. |
+struct PPDFile { |
+ // Identifier from the quirks server. -1 otherwise. |
stevenjb
2016/07/29 16:56:50
nit: Typically we only use a single space between
skau
2016/08/01 19:37:19
Done.
|
+ int id; |
+ |
+ std::string file_name; |
+ |
+ // If there is a file with a later version on the quirks server, that file |
+ // should be used. The default value is 0. |
+ int version_number; |
+ |
+ // This will be true if the file was retrived from the quirks server. |
+ // Otherwise, the file was saved to disk by the user. |
+ bool from_quirks_server; |
+}; |
stevenjb
2016/07/29 16:56:50
Can we embed this in the Printer class instead of
skau
2016/08/01 19:37:19
Done.
|
+ |
+class Printer { |
+ public: |
+ Printer(); |
stevenjb
2016/07/29 16:56:50
Do we need a default constructor?
skau
2016/08/01 19:37:19
I think it's clearer than constructing it with an
stevenjb
2016/08/01 20:48:16
Generally we try to avoid multiple constructors si
skau
2016/08/01 21:10:10
The use cases are different so I'm going to leave
|
+ explicit Printer(const std::string& id); |
+ |
+ ~Printer(); |
+ |
+ const std::string& id() const { return id_; } |
+ void set_id(const std::string& id) { id_ = id; } |
+ |
+ const std::string& display_name() const { return display_name_; } |
+ void set_display_name(const std::string& display_name) { |
+ display_name_ = display_name; |
+ } |
+ |
+ const std::string& description() const { return description_; } |
+ void set_description(const std::string& description) { |
+ description_ = description; |
+ } |
+ |
+ const std::string& manufacturer() const { return manufacturer_; } |
+ void set_manufacturer(const std::string& manufacturer) { |
+ manufacturer_ = manufacturer; |
+ } |
+ |
+ const std::string& model() const { return model_; } |
+ void set_model(const std::string& model) { model_ = model; } |
+ |
+ const std::string& uri() const { return uri_; } |
+ void set_uri(const std::string& uri) { uri_ = uri; } |
+ |
+ const PPDFile& ppd() const { return ppd_; } |
+ void set_ppd(const PPDFile& ppd) { ppd_ = ppd; } |
+ |
+ const std::string& uuid() const { return uuid_; } |
+ void set_uuid(const std::string& uuid) { uuid_ = uuid; } |
+ |
+ private: |
+ // Globally unique identifier. Empty indicates a new printer. |
+ std::string id_; |
+ |
+ // User defined string for printer identification. |
+ std::string display_name_; |
+ |
+ // User defined string for additional printer information. |
+ std::string description_; |
+ |
+ // The manufacturer of the printer. e.g. HP |
stevenjb
2016/07/29 16:56:50
punctuation nit: ', e.g. HP.'
skau
2016/08/01 19:37:19
Done.
|
+ std::string manufacturer_; |
+ |
+ // The model of the printer. e.g. OfficeJet 415 |
stevenjb
2016/07/29 16:56:50
ditto
skau
2016/08/01 19:37:19
Done.
|
+ std::string model_; |
+ |
+ // The full path for the printer. Suitable for configuration in CUPS. |
+ // Contains protocol, hostname, port, and queue. |
+ std::string uri_; |
+ |
+ // The associated postscript printer description. |
+ PPDFile ppd_; |
+ |
+ // The UUID from an autoconf protocol for deduplication. Could be empty. |
+ std::string uuid_; |
stevenjb
2016/07/29 16:56:50
DISALLOW_COPY_AND_ASSIGN
skau
2016/08/01 19:37:19
Done.
|
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ |