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

Unified Diff: chromeos/printing/printer_configuration.h

Issue 2343983004: Add PPDProvider barebones implementation and associated cache skeleton. (Closed)
Patch Set: Initial PPDProvider/PPDCache implementation. Also, add associated unittests. This doesn't plumb th… Created 4 years, 2 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: chromeos/printing/printer_configuration.h
diff --git a/chromeos/printing/printer_configuration.h b/chromeos/printing/printer_configuration.h
index fc82c293798c94a84e7f71e5216374fdf54c69d9..ca888320c2b374c0864f490240e052af8bcdf124 100644
--- a/chromeos/printing/printer_configuration.h
+++ b/chromeos/printing/printer_configuration.h
@@ -15,21 +15,23 @@ namespace chromeos {
class CHROMEOS_EXPORT Printer {
public:
- // Represents a Postscript Printer Description with which the printer was
- // setup.
- struct PPDFile {
- // Identifier from the quirks server. -1 otherwise.
- int id = -1;
-
- 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 = 0;
-
- // 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 = false;
+ // Information needed to find the PPD file for this printer.
+ //
+ // If you add fields to this struct, you almost certainly will
+ // want to update PpdResolver and PpdCache::GetCachePath.
skau 2016/10/14 22:10:17 We should include the resolution hierarchy in this
Carlson 2016/10/14 23:05:56 Done.
+ struct PpdReference {
+ // If non-empty, this is the url of a specific PPD the user has specified
+ // for use with this printer.
+ std::string user_supplied_ppd_url;
+
+ // The *effective* manufacturer and model of this printer, in other words,
+ // the manufacturer and model of the printer for which we grab a PPD.  This
+ // doesn’t have to (but can) be the actual manufacturer/model of the
+ // printer.  We should always try to fill these fields in, even if we don’t
+ // think they’ll be needed, as they provide a fallback mechanism for
+ // finding a PPD.
+ std::string effective_manufacturer;
+ std::string effective_model;
};
// Constructs a printer object that is completely empty.
@@ -68,8 +70,8 @@ class CHROMEOS_EXPORT Printer {
const std::string& uri() const { return uri_; }
void set_uri(const std::string& uri) { uri_ = uri; }
- const PPDFile& ppd() const { return ppd_; }
- void SetPPD(std::unique_ptr<PPDFile> ppd);
+ const PpdReference& ppd_reference() const { return ppd_reference_; }
+ PpdReference* mutable_ppd_reference() { return &ppd_reference_; }
const std::string& uuid() const { return uuid_; }
void set_uuid(const std::string& uuid) { uuid_ = uuid; }
@@ -94,8 +96,8 @@ class CHROMEOS_EXPORT Printer {
// Contains protocol, hostname, port, and queue.
std::string uri_;
- // The associated postscript printer description.
- PPDFile ppd_;
+ // How to find the associated postscript printer description.
+ PpdReference ppd_reference_;
// The UUID from an autoconf protocol for deduplication. Could be empty.
std::string uuid_;

Powered by Google App Engine
This is Rietveld 408576698