OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_API_H_ |
6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_API_H_ | 6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_API_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // Completes the request with the provided request id. It runs the request | 202 // Completes the request with the provided request id. It runs the request |
203 // callback and removes the request from the set. | 203 // callback and removes the request from the set. |
204 bool Complete(int request_id, PrintError result); | 204 bool Complete(int request_id, PrintError result); |
205 | 205 |
206 private: | 206 private: |
207 int last_request_id_; | 207 int last_request_id_; |
208 std::map<int, PrintCallback> pending_requests_; | 208 std::map<int, PrintCallback> pending_requests_; |
209 }; | 209 }; |
210 | 210 |
211 // BrowserContextKeyedAPI implementation. | 211 // BrowserContextKeyedAPI implementation. |
| 212 static const bool kServiceRedirectedInIncognito = true; |
212 static const char* service_name() { return "PrinterProvider"; } | 213 static const char* service_name() { return "PrinterProvider"; } |
213 | 214 |
214 // PrinterProviderInternalAPIObserver implementation: | 215 // PrinterProviderInternalAPIObserver implementation: |
215 void OnGetPrintersResult( | 216 void OnGetPrintersResult( |
216 const Extension* extension, | 217 const Extension* extension, |
217 int request_id, | 218 int request_id, |
218 const PrinterProviderInternalAPIObserver::PrinterInfoVector& result) | 219 const PrinterProviderInternalAPIObserver::PrinterInfoVector& result) |
219 override; | 220 override; |
220 void OnGetCapabilityResult(const Extension* extension, | 221 void OnGetCapabilityResult(const Extension* extension, |
221 int request_id, | 222 int request_id, |
(...skipping 28 matching lines...) Expand all Loading... |
250 DISALLOW_COPY_AND_ASSIGN(PrinterProviderAPI); | 251 DISALLOW_COPY_AND_ASSIGN(PrinterProviderAPI); |
251 }; | 252 }; |
252 | 253 |
253 template <> | 254 template <> |
254 void BrowserContextKeyedAPIFactory< | 255 void BrowserContextKeyedAPIFactory< |
255 PrinterProviderAPI>::DeclareFactoryDependencies(); | 256 PrinterProviderAPI>::DeclareFactoryDependencies(); |
256 | 257 |
257 } // namespace extensions | 258 } // namespace extensions |
258 | 259 |
259 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_API_H_ | 260 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_API_H_ |
OLD | NEW |