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

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

Issue 2613683004: Completely rewrite the PpdProvider/PpdCache to use the SCS backend. Along the way, clean it up a l… (Closed)
Patch Set: Address michealpg@ comments Created 3 years, 10 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
« no previous file with comments | « chromeos/printing/ppd_provider_unittest.cc ('k') | chromeos/printing/printer_translator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
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. This
31 // url must use a file:// scheme.
34 std::string user_supplied_ppd_url; 32 std::string user_supplied_ppd_url;
35 33
36 // The *effective* manufacturer and model of this printer, in other words, 34 // 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 35 // Where possible, this is the same as the ipp/ldap
38 // doesn’t have to (but can) be the actual manufacturer/model of the 36 // printer-make-and-model field.
39 // printer.  We should always try to fill these fields in, even if we don’t 37 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 }; 38 };
45 39
46 // The location where the printer is stored. 40 // The location where the printer is stored.
47 enum Source { 41 enum Source {
48 SRC_USER_PREFS, 42 SRC_USER_PREFS,
49 SRC_POLICY, 43 SRC_POLICY,
50 }; 44 };
51 45
52 // Constructs a printer object that is completely empty. 46 // Constructs a printer object that is completely empty.
53 Printer(); 47 Printer();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // The UUID from an autoconf protocol for deduplication. Could be empty. 119 // The UUID from an autoconf protocol for deduplication. Could be empty.
126 std::string uuid_; 120 std::string uuid_;
127 121
128 // The datastore which holds this printer. 122 // The datastore which holds this printer.
129 Source source_; 123 Source source_;
130 }; 124 };
131 125
132 } // namespace chromeos 126 } // namespace chromeos
133 127
134 #endif // CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ 128 #endif // CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_
OLDNEW
« no previous file with comments | « chromeos/printing/ppd_provider_unittest.cc ('k') | chromeos/printing/printer_translator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698