OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 virtual void OnPrivetPrintingError( | 92 virtual void OnPrivetPrintingError( |
93 const local_discovery::PrivetLocalPrintOperation* print_operation, | 93 const local_discovery::PrivetLocalPrintOperation* print_operation, |
94 int http_code) OVERRIDE; | 94 int http_code) OVERRIDE; |
95 #endif // ENABLE_SERVICE_DISCOVERY | 95 #endif // ENABLE_SERVICE_DISCOVERY |
96 int regenerate_preview_request_count() const { | 96 int regenerate_preview_request_count() const { |
97 return regenerate_preview_request_count_; | 97 return regenerate_preview_request_count_; |
98 } | 98 } |
99 | 99 |
100 private: | 100 private: |
101 class AccessTokenService; | 101 class AccessTokenService; |
102 struct CUPSPrinterColorModels; | |
103 | 102 |
104 static bool PrivetPrintingEnabled(); | 103 static bool PrivetPrintingEnabled(); |
105 | 104 |
106 content::WebContents* preview_web_contents() const; | 105 content::WebContents* preview_web_contents() const; |
107 | 106 |
108 // Gets the list of printers. |args| is unused. | 107 // Gets the list of printers. |args| is unused. |
109 void HandleGetPrinters(const base::ListValue* args); | 108 void HandleGetPrinters(const base::ListValue* args); |
110 | 109 |
111 // Starts getting all local privet printers. |arg| is unused. | 110 // Starts getting all local privet printers. |arg| is unused. |
112 void HandleGetPrivetPrinters(const base::ListValue* args); | 111 void HandleGetPrivetPrinters(const base::ListValue* args); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 // Whether we have already logged the number of printers this session. | 288 // Whether we have already logged the number of printers this session. |
290 bool has_logged_printers_count_; | 289 bool has_logged_printers_count_; |
291 | 290 |
292 // Holds the path to the print to pdf request. It is empty if no such request | 291 // Holds the path to the print to pdf request. It is empty if no such request |
293 // exists. | 292 // exists. |
294 base::FilePath print_to_pdf_path_; | 293 base::FilePath print_to_pdf_path_; |
295 | 294 |
296 // Holds token service to get OAuth2 access tokens. | 295 // Holds token service to get OAuth2 access tokens. |
297 scoped_ptr<AccessTokenService> token_service_; | 296 scoped_ptr<AccessTokenService> token_service_; |
298 | 297 |
299 #if defined(USE_CUPS) | |
300 // The color capabilities from the last printer queried. | |
301 scoped_ptr<CUPSPrinterColorModels> cups_printer_color_models_; | |
302 #endif | |
303 | |
304 #if defined(ENABLE_SERVICE_DISCOVERY) | 298 #if defined(ENABLE_SERVICE_DISCOVERY) |
305 scoped_refptr<local_discovery::ServiceDiscoverySharedClient> | 299 scoped_refptr<local_discovery::ServiceDiscoverySharedClient> |
306 service_discovery_client_; | 300 service_discovery_client_; |
307 scoped_ptr<local_discovery::PrivetLocalPrinterLister> printer_lister_; | 301 scoped_ptr<local_discovery::PrivetLocalPrinterLister> printer_lister_; |
308 | 302 |
309 scoped_ptr<local_discovery::PrivetHTTPAsynchronousFactory> | 303 scoped_ptr<local_discovery::PrivetHTTPAsynchronousFactory> |
310 privet_http_factory_; | 304 privet_http_factory_; |
311 scoped_ptr<local_discovery::PrivetHTTPResolution> privet_http_resolution_; | 305 scoped_ptr<local_discovery::PrivetHTTPResolution> privet_http_resolution_; |
312 scoped_ptr<local_discovery::PrivetHTTPClient> privet_http_client_; | 306 scoped_ptr<local_discovery::PrivetHTTPClient> privet_http_client_; |
313 scoped_ptr<local_discovery::PrivetJSONOperation> | 307 scoped_ptr<local_discovery::PrivetJSONOperation> |
314 privet_capabilities_operation_; | 308 privet_capabilities_operation_; |
315 scoped_ptr<local_discovery::PrivetLocalPrintOperation> | 309 scoped_ptr<local_discovery::PrivetLocalPrintOperation> |
316 privet_local_print_operation_; | 310 privet_local_print_operation_; |
317 #endif | 311 #endif |
318 | 312 |
319 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 313 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; |
320 | 314 |
321 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 315 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
322 }; | 316 }; |
323 | 317 |
324 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 318 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
OLD | NEW |