| 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_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/gtest_prod_util.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 15 #include "chrome/browser/printing/print_view_manager_observer.h" | 16 #include "chrome/browser/printing/print_view_manager_observer.h" |
| 16 #include "chrome/browser/ui/select_file_dialog.h" | 17 #include "chrome/browser/ui/select_file_dialog.h" |
| 17 #include "content/browser/webui/web_ui.h" | 18 #include "content/public/browser/web_ui_message_handler.h" |
| 18 #include "printing/print_job_constants.h" | 19 #include "printing/print_job_constants.h" |
| 19 | 20 |
| 20 class FilePath; | 21 class FilePath; |
| 21 class PrintSystemTaskProxy; | 22 class PrintSystemTaskProxy; |
| 22 class TabContentsWrapper; | 23 class TabContentsWrapper; |
| 23 | 24 |
| 24 namespace base { | 25 namespace base { |
| 25 class DictionaryValue; | 26 class DictionaryValue; |
| 26 class StringValue; | 27 class StringValue; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace printing { | 30 namespace printing { |
| 30 struct PageSizeMargins; | 31 struct PageSizeMargins; |
| 31 class PrintBackend; | 32 class PrintBackend; |
| 32 } | 33 } |
| 33 | 34 |
| 34 // The handler for Javascript messages related to the print preview dialog. | 35 // The handler for Javascript messages related to the print preview dialog. |
| 35 class PrintPreviewHandler : public WebUIMessageHandler, | 36 class PrintPreviewHandler : public content::WebUIMessageHandler, |
| 36 public base::SupportsWeakPtr<PrintPreviewHandler>, | 37 public base::SupportsWeakPtr<PrintPreviewHandler>, |
| 37 public SelectFileDialog::Listener, | 38 public SelectFileDialog::Listener, |
| 38 public printing::PrintViewManagerObserver { | 39 public printing::PrintViewManagerObserver { |
| 39 public: | 40 public: |
| 40 PrintPreviewHandler(); | 41 PrintPreviewHandler(); |
| 41 virtual ~PrintPreviewHandler(); | 42 virtual ~PrintPreviewHandler(); |
| 42 | 43 |
| 43 // WebUIMessageHandler implementation. | 44 // WebUIMessageHandler implementation. |
| 44 virtual void RegisterMessages() OVERRIDE; | 45 virtual void RegisterMessages() OVERRIDE; |
| 45 | 46 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 bool has_logged_printers_count_; | 208 bool has_logged_printers_count_; |
| 208 | 209 |
| 209 // Holds the path to the print to pdf request. It is empty if no such request | 210 // Holds the path to the print to pdf request. It is empty if no such request |
| 210 // exists. | 211 // exists. |
| 211 scoped_ptr<FilePath> print_to_pdf_path_; | 212 scoped_ptr<FilePath> print_to_pdf_path_; |
| 212 | 213 |
| 213 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 214 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 214 }; | 215 }; |
| 215 | 216 |
| 216 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 217 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |