| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DOM_UI_PRINT_PREVIEW_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_HANDLER_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_HANDLER_H_ | 6 #define CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/weak_ptr.h" | 10 #include "base/weak_ptr.h" |
| 11 #include "chrome/browser/dom_ui/dom_ui.h" | 11 #include "chrome/browser/dom_ui/dom_ui.h" |
| 12 | 12 |
| 13 namespace printing { | 13 namespace printing { |
| 14 class PrintBackend; | 14 class PrintBackend; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // The handler for Javascript messages related to the "print preview" dialog. | 17 // The handler for Javascript messages related to the "print preview" dialog. |
| 18 class PrintPreviewHandler : public WebUIMessageHandler, | 18 class PrintPreviewHandler : public WebUIMessageHandler, |
| 19 public base::SupportsWeakPtr<PrintPreviewHandler> { | 19 public base::SupportsWeakPtr<PrintPreviewHandler> { |
| 20 public: | 20 public: |
| 21 PrintPreviewHandler(); | 21 PrintPreviewHandler(); |
| 22 virtual ~PrintPreviewHandler(); | 22 virtual ~PrintPreviewHandler(); |
| 23 | 23 |
| 24 // WebUIMessageHandler implementation. | 24 // WebUIMessageHandler implementation. |
| 25 virtual void RegisterMessages(); | 25 virtual void RegisterMessages(); |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 // Get the list of printers and send it to the Web UI. |args| is unused. | 28 // Get the list of printers and send it to the Web UI. |args| is unused. |
| 29 void HandleGetPrinters(const ListValue* args); | 29 void HandleGetPrinters(const ListValue* args); |
| 30 void HandlePrint(const ListValue* args); |
| 30 | 31 |
| 31 // Pointer to current print system. | 32 // Pointer to current print system. |
| 32 scoped_refptr<printing::PrintBackend> print_backend_; | 33 scoped_refptr<printing::PrintBackend> print_backend_; |
| 33 | 34 |
| 34 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 35 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 #endif // CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_HANDLER_H_ | 38 #endif // CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |