| 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 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace content { | 30 namespace content { |
| 31 class WebContents; | 31 class WebContents; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace gfx { | 34 namespace gfx { |
| 35 class Size; | 35 class Size; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace printing { | |
| 39 struct PageSizeMargins; | |
| 40 class PrintBackend; | |
| 41 } | |
| 42 | |
| 43 // The handler for Javascript messages related to the print preview dialog. | 38 // The handler for Javascript messages related to the print preview dialog. |
| 44 class PrintPreviewHandler | 39 class PrintPreviewHandler |
| 45 : public content::WebUIMessageHandler, | 40 : public content::WebUIMessageHandler, |
| 46 #if defined(ENABLE_SERVICE_DISCOVERY) | 41 #if defined(ENABLE_SERVICE_DISCOVERY) |
| 47 public local_discovery::PrivetLocalPrinterLister::Delegate, | 42 public local_discovery::PrivetLocalPrinterLister::Delegate, |
| 48 public local_discovery::PrivetLocalPrintOperation::Delegate, | 43 public local_discovery::PrivetLocalPrintOperation::Delegate, |
| 49 #endif | 44 #endif |
| 50 public ui::SelectFileDialog::Listener, | 45 public ui::SelectFileDialog::Listener, |
| 51 public printing::PrintViewManagerObserver { | 46 public printing::PrintViewManagerObserver { |
| 52 public: | 47 public: |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 const std::string& name, | 265 const std::string& name, |
| 271 const local_discovery::PrivetHTTPAsynchronousFactory::ResultCallback& | 266 const local_discovery::PrivetHTTPAsynchronousFactory::ResultCallback& |
| 272 callback); | 267 callback); |
| 273 void FillPrinterDescription( | 268 void FillPrinterDescription( |
| 274 const std::string& name, | 269 const std::string& name, |
| 275 const local_discovery::DeviceDescription& description, | 270 const local_discovery::DeviceDescription& description, |
| 276 bool has_local_printing, | 271 bool has_local_printing, |
| 277 base::DictionaryValue* printer_value); | 272 base::DictionaryValue* printer_value); |
| 278 #endif | 273 #endif |
| 279 | 274 |
| 280 // Pointer to current print system. | |
| 281 scoped_refptr<printing::PrintBackend> print_backend_; | |
| 282 | |
| 283 // The underlying dialog object. | 275 // The underlying dialog object. |
| 284 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; | 276 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
| 285 | 277 |
| 286 // A count of how many requests received to regenerate preview data. | 278 // A count of how many requests received to regenerate preview data. |
| 287 // Initialized to 0 then incremented and emitted to a histogram. | 279 // Initialized to 0 then incremented and emitted to a histogram. |
| 288 int regenerate_preview_request_count_; | 280 int regenerate_preview_request_count_; |
| 289 | 281 |
| 290 // A count of how many requests received to show manage printers dialog. | 282 // A count of how many requests received to show manage printers dialog. |
| 291 int manage_printers_dialog_request_count_; | 283 int manage_printers_dialog_request_count_; |
| 292 int manage_cloud_printers_dialog_request_count_; | 284 int manage_cloud_printers_dialog_request_count_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 323 scoped_ptr<local_discovery::PrivetLocalPrintOperation> | 315 scoped_ptr<local_discovery::PrivetLocalPrintOperation> |
| 324 privet_local_print_operation_; | 316 privet_local_print_operation_; |
| 325 #endif | 317 #endif |
| 326 | 318 |
| 327 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 319 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; |
| 328 | 320 |
| 329 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 321 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 330 }; | 322 }; |
| 331 | 323 |
| 332 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 324 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |