| 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 <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 int http_code) override; | 109 int http_code) override; |
| 110 #endif | 110 #endif |
| 111 | 111 |
| 112 int regenerate_preview_request_count() const { | 112 int regenerate_preview_request_count() const { |
| 113 return regenerate_preview_request_count_; | 113 return regenerate_preview_request_count_; |
| 114 } | 114 } |
| 115 | 115 |
| 116 // Sets |pdf_file_saved_closure_| to |closure|. | 116 // Sets |pdf_file_saved_closure_| to |closure|. |
| 117 void SetPdfSavedClosureForTesting(const base::Closure& closure); | 117 void SetPdfSavedClosureForTesting(const base::Closure& closure); |
| 118 | 118 |
| 119 // Fires the 'enable-manipulate-settings-for-test' WebUI event. |
| 120 void SendEnableManipulateSettingsForTest(); |
| 121 |
| 122 // Fires the 'manipulate-settings-for-test' WebUI event with |settings|. |
| 123 void SendManipulateSettingsForTest(const base::DictionaryValue& settings); |
| 124 |
| 119 protected: | 125 protected: |
| 120 // If |prompt_user| is true, starts a task to create the default Save As PDF | 126 // If |prompt_user| is true, starts a task to create the default Save As PDF |
| 121 // directory if needed. OnDirectoryCreated() will be called when it | 127 // directory if needed. OnDirectoryCreated() will be called when it |
| 122 // finishes to open the modal dialog and prompt the user. Otherwise, just | 128 // finishes to open the modal dialog and prompt the user. Otherwise, just |
| 123 // accept |default_path| and uniquify it. | 129 // accept |default_path| and uniquify it. |
| 124 // Protected so unit tests can access. | 130 // Protected so unit tests can access. |
| 125 virtual void SelectFile(const base::FilePath& default_path, bool prompt_user); | 131 virtual void SelectFile(const base::FilePath& default_path, bool prompt_user); |
| 126 | 132 |
| 127 // Handles printing to PDF. Protected to expose to unit tests. | 133 // Handles printing to PDF. Protected to expose to unit tests. |
| 128 void PrintToPdf(); | 134 void PrintToPdf(); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // Proxy for calls to the print backend. Lazily initialized since web_ui() is | 457 // Proxy for calls to the print backend. Lazily initialized since web_ui() is |
| 452 // not available at construction time. | 458 // not available at construction time. |
| 453 std::unique_ptr<printing::PrinterBackendProxy> printer_backend_proxy_; | 459 std::unique_ptr<printing::PrinterBackendProxy> printer_backend_proxy_; |
| 454 | 460 |
| 455 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 461 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; |
| 456 | 462 |
| 457 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 463 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 458 }; | 464 }; |
| 459 | 465 |
| 460 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 466 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |