| 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 <memory> | 8 #include <memory> | 
| 9 #include <string> | 9 #include <string> | 
| 10 | 10 | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 34 } | 34 } | 
| 35 | 35 | 
| 36 namespace content { | 36 namespace content { | 
| 37 class WebContents; | 37 class WebContents; | 
| 38 } | 38 } | 
| 39 | 39 | 
| 40 namespace gfx { | 40 namespace gfx { | 
| 41 class Size; | 41 class Size; | 
| 42 } | 42 } | 
| 43 | 43 | 
|  | 44 namespace printing { | 
|  | 45 class PrinterBackendProxy; | 
|  | 46 } | 
|  | 47 | 
| 44 // The handler for Javascript messages related to the print preview dialog. | 48 // The handler for Javascript messages related to the print preview dialog. | 
| 45 class PrintPreviewHandler | 49 class PrintPreviewHandler | 
| 46     : public content::WebUIMessageHandler, | 50     : public content::WebUIMessageHandler, | 
| 47 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) | 51 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) | 
| 48       public cloud_print::PrivetLocalPrinterLister::Delegate, | 52       public cloud_print::PrivetLocalPrinterLister::Delegate, | 
| 49       public cloud_print::PrivetLocalPrintOperation::Delegate, | 53       public cloud_print::PrivetLocalPrintOperation::Delegate, | 
| 50 #endif | 54 #endif | 
| 51       public ui::SelectFileDialog::Listener, | 55       public ui::SelectFileDialog::Listener, | 
| 52       public GaiaCookieManagerService::Observer { | 56       public GaiaCookieManagerService::Observer { | 
| 53  public: | 57  public: | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 104  private: | 108  private: | 
| 105   friend class PrintPreviewPdfGeneratedBrowserTest; | 109   friend class PrintPreviewPdfGeneratedBrowserTest; | 
| 106   FRIEND_TEST_ALL_PREFIXES(PrintPreviewPdfGeneratedBrowserTest, | 110   FRIEND_TEST_ALL_PREFIXES(PrintPreviewPdfGeneratedBrowserTest, | 
| 107                            MANUAL_DummyTest); | 111                            MANUAL_DummyTest); | 
| 108   class AccessTokenService; | 112   class AccessTokenService; | 
| 109 | 113 | 
| 110   content::WebContents* preview_web_contents() const; | 114   content::WebContents* preview_web_contents() const; | 
| 111 | 115 | 
| 112   PrintPreviewUI* print_preview_ui() const; | 116   PrintPreviewUI* print_preview_ui() const; | 
| 113 | 117 | 
|  | 118   printing::PrinterBackendProxy* printer_backend_proxy(); | 
|  | 119 | 
| 114   // Gets the list of printers. |args| is unused. | 120   // Gets the list of printers. |args| is unused. | 
| 115   void HandleGetPrinters(const base::ListValue* args); | 121   void HandleGetPrinters(const base::ListValue* args); | 
| 116 | 122 | 
| 117   // Starts getting all local privet printers. |args| is unused. | 123   // Starts getting all local privet printers. |args| is unused. | 
| 118   void HandleGetPrivetPrinters(const base::ListValue* args); | 124   void HandleGetPrivetPrinters(const base::ListValue* args); | 
| 119 | 125 | 
| 120   // Starts getting all local extension managed printers. |args| is unused. | 126   // Starts getting all local extension managed printers. |args| is unused. | 
| 121   void HandleGetExtensionPrinters(const base::ListValue* args); | 127   void HandleGetExtensionPrinters(const base::ListValue* args); | 
| 122 | 128 | 
| 123   // Grants an extension access to a provisional printer.  First element of | 129   // Grants an extension access to a provisional printer.  First element of | 
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 373 #endif | 379 #endif | 
| 374 | 380 | 
| 375   // Handles requests for extension printers. Created lazily by calling | 381   // Handles requests for extension printers. Created lazily by calling | 
| 376   // |EnsureExtensionPrinterHandlerSet|. | 382   // |EnsureExtensionPrinterHandlerSet|. | 
| 377   std::unique_ptr<PrinterHandler> extension_printer_handler_; | 383   std::unique_ptr<PrinterHandler> extension_printer_handler_; | 
| 378 | 384 | 
| 379   // Notifies tests that want to know if the PDF has been saved. This doesn't | 385   // Notifies tests that want to know if the PDF has been saved. This doesn't | 
| 380   // notify the test if it was a successful save, only that it was attempted. | 386   // notify the test if it was a successful save, only that it was attempted. | 
| 381   base::Closure pdf_file_saved_closure_; | 387   base::Closure pdf_file_saved_closure_; | 
| 382 | 388 | 
|  | 389   // Proxy for calls to the print backend.  Lazily initialized since web_ui() is | 
|  | 390   // not available at construction time. | 
|  | 391   std::unique_ptr<printing::PrinterBackendProxy> printer_backend_proxy_; | 
|  | 392 | 
| 383   base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 393   base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 
| 384 | 394 | 
| 385   DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 395   DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 
| 386 }; | 396 }; | 
| 387 | 397 | 
| 388 #endif  // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 398 #endif  // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 
| OLD | NEW | 
|---|