Chromium Code Reviews| OLD | NEW | 
|---|---|
| 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 | 
| 11 #include "base/macros.h" | 11 #include "base/macros.h" | 
| 12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" | 
| 13 | 13 | 
| 14 namespace chromeos { | 14 namespace chromeos { | 
| 15 | 15 | 
| 16 class CHROMEOS_EXPORT Printer { | 16 class CHROMEOS_EXPORT Printer { | 
| 17 public: | 17 public: | 
| 18 // Information needed to find the PPD file for this printer. | 18 // Information needed to find the PPD file for this printer. | 
| 19 // | 19 // | 
| 20 // If you add fields to this struct, you almost certainly will | 20 // If you add fields to this struct, you almost certainly will | 
| 21 // want to update PpdResolver and PpdCache::GetCachePath. | 21 // want to update PpdResolver and PpdCache::GetCachePath. | 
| 22 // | 22 // | 
| 23 // Exactly one of the fields below should be filled in. | |
| 24 // | |
| 23 // At resolution time, we look for a cached PPD that used the same | 25 // At resolution time, we look for a cached PPD that used the same | 
| 24 // PpdReference before. | 26 // PpdReference before. | 
| 25 // | 27 // | 
| 26 // If one is not found and user_supplied_ppd_url is set, we'll fail | |
| 27 // out with NOT FOUND | |
| 28 // | |
| 29 // Otherwise, we'll hit QuirksServer to see if we can resolve a Ppd | |
| 30 // using manufacturer/model | |
| 31 struct PpdReference { | 28 struct PpdReference { | 
| 32 // If non-empty, this is the url of a specific PPD the user has specified | 29 // If non-empty, this is the url of a specific PPD the user has specified | 
| 33 // for use with this printer. | 30 // for use with this printer. The ppd can be gzipped or uncompressed. | 
| 34 std::string user_supplied_ppd_url; | 31 std::string user_supplied_ppd_url; | 
| 
 
skau
2017/01/27 01:37:01
Note: Technically, this is a uri rather than a url
 
Carlson
2017/01/27 18:48:43
I've always been a little hazy on the distinction,
 
 | |
| 35 | 32 | 
| 36 // The *effective* manufacturer and model of this printer, in other words, | 33 // String that identifies which ppd to use from the ppd server. | 
| 37 // the manufacturer and model of the printer for which we grab a PPD. This | 34 // Where possible, this is the same as the ipp/ldap | 
| 38 // doesn’t have to (but can) be the actual manufacturer/model of the | 35 // printer-make-and-model field. | 
| 39 // printer. We should always try to fill these fields in, even if we don’t | 36 std::string effective_make_and_model; | 
| 40 // think they’ll be needed, as they provide a fallback mechanism for | |
| 41 // finding a PPD. | |
| 42 std::string effective_manufacturer; | |
| 43 std::string effective_model; | |
| 44 }; | 37 }; | 
| 45 | 38 | 
| 46 // The location where the printer is stored. | 39 // The location where the printer is stored. | 
| 47 enum Source { | 40 enum Source { | 
| 48 SRC_USER_PREFS, | 41 SRC_USER_PREFS, | 
| 49 SRC_POLICY, | 42 SRC_POLICY, | 
| 50 }; | 43 }; | 
| 51 | 44 | 
| 52 // Constructs a printer object that is completely empty. | 45 // Constructs a printer object that is completely empty. | 
| 53 Printer(); | 46 Printer(); | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 // The UUID from an autoconf protocol for deduplication. Could be empty. | 118 // The UUID from an autoconf protocol for deduplication. Could be empty. | 
| 126 std::string uuid_; | 119 std::string uuid_; | 
| 127 | 120 | 
| 128 // The datastore which holds this printer. | 121 // The datastore which holds this printer. | 
| 129 Source source_; | 122 Source source_; | 
| 130 }; | 123 }; | 
| 131 | 124 | 
| 132 } // namespace chromeos | 125 } // namespace chromeos | 
| 133 | 126 | 
| 134 #endif // CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ | 127 #endif // CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ | 
| OLD | NEW |