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_PPD_PROVIDER_H_ | 5 #ifndef CHROMEOS_PRINTING_PPD_PROVIDER_H_ |
6 #define CHROMEOS_PRINTING_PPD_PROVIDER_H_ | 6 #define CHROMEOS_PRINTING_PPD_PROVIDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/sequenced_task_runner.h" | |
16 #include "chromeos/chromeos_export.h" | 15 #include "chromeos/chromeos_export.h" |
17 #include "chromeos/printing/printer_configuration.h" | 16 #include "chromeos/printing/printer_configuration.h" |
18 | 17 |
19 namespace net { | 18 namespace net { |
20 class URLRequestContextGetter; | 19 class URLRequestContextGetter; |
21 } | 20 } |
22 | 21 |
23 namespace chromeos { | 22 namespace chromeos { |
24 namespace printing { | 23 namespace printing { |
25 | 24 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // NOT_FOUND means we don't know about this Usb device. | 83 // NOT_FOUND means we don't know about this Usb device. |
85 using ResolveUsbIdsCallback = | 84 using ResolveUsbIdsCallback = |
86 base::Callback<void(CallbackResultCode, const std::string&)>; | 85 base::Callback<void(CallbackResultCode, const std::string&)>; |
87 | 86 |
88 // Create and return a new PpdProvider with the given cache and options. | 87 // Create and return a new PpdProvider with the given cache and options. |
89 // A references to |url_context_getter| is taken. | 88 // A references to |url_context_getter| is taken. |
90 static scoped_refptr<PpdProvider> Create( | 89 static scoped_refptr<PpdProvider> Create( |
91 const std::string& browser_locale, | 90 const std::string& browser_locale, |
92 scoped_refptr<net::URLRequestContextGetter> url_context_getter, | 91 scoped_refptr<net::URLRequestContextGetter> url_context_getter, |
93 scoped_refptr<PpdCache> cache, | 92 scoped_refptr<PpdCache> cache, |
94 scoped_refptr<base::SequencedTaskRunner> disk_task_runner, | |
95 const Options& options = Options()); | 93 const Options& options = Options()); |
96 | 94 |
97 // Get all manufacturers for which we have drivers. Keys of the map will be | 95 // Get all manufacturers for which we have drivers. Keys of the map will be |
98 // localized in the default browser locale or the closest available fallback. | 96 // localized in the default browser locale or the closest available fallback. |
99 // | 97 // |
100 // |cb| will be called on the invoking thread, and will be sequenced. | 98 // |cb| will be called on the invoking thread, and will be sequenced. |
101 virtual void ResolveManufacturers(const ResolveManufacturersCallback& cb) = 0; | 99 virtual void ResolveManufacturers(const ResolveManufacturersCallback& cb) = 0; |
102 | 100 |
103 // Get all models from a given manufacturer, localized in the default browser | 101 // Get all models from a given manufacturer, localized in the default browser |
104 // locale or the closest available fallback. |manufacturer| must be a value | 102 // locale or the closest available fallback. |manufacturer| must be a value |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 138 |
141 protected: | 139 protected: |
142 friend class base::RefCounted<PpdProvider>; | 140 friend class base::RefCounted<PpdProvider>; |
143 virtual ~PpdProvider() {} | 141 virtual ~PpdProvider() {} |
144 }; | 142 }; |
145 | 143 |
146 } // namespace printing | 144 } // namespace printing |
147 } // namespace chromeos | 145 } // namespace chromeos |
148 | 146 |
149 #endif // CHROMEOS_PRINTING_PPD_PROVIDER_H_ | 147 #endif // CHROMEOS_PRINTING_PPD_PROVIDER_H_ |
OLD | NEW |