| 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_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 void OnReloadPrintersList(); | 144 void OnReloadPrintersList(); |
| 145 | 145 |
| 146 // Notifies the WebUI to set print preset options from source PDF. | 146 // Notifies the WebUI to set print preset options from source PDF. |
| 147 void OnSetOptionsFromDocument( | 147 void OnSetOptionsFromDocument( |
| 148 const PrintHostMsg_SetOptionsFromDocument_Params& params); | 148 const PrintHostMsg_SetOptionsFromDocument_Params& params); |
| 149 | 149 |
| 150 // Allows tests to wait until the print preview dialog is loaded. Optionally | 150 // Allows tests to wait until the print preview dialog is loaded. Optionally |
| 151 // also instructs the dialog to auto-cancel, which is used for testing only. | 151 // also instructs the dialog to auto-cancel, which is used for testing only. |
| 152 class TestingDelegate { | 152 class TestingDelegate { |
| 153 public: | 153 public: |
| 154 virtual bool IsAutoCancelEnabled() = 0; | |
| 155 virtual void DidGetPreviewPageCount(int page_count) = 0; | 154 virtual void DidGetPreviewPageCount(int page_count) = 0; |
| 156 virtual void DidRenderPreviewPage(content::WebContents* preview_dialog) = 0; | 155 virtual void DidRenderPreviewPage(content::WebContents* preview_dialog) = 0; |
| 157 }; | 156 }; |
| 158 | 157 |
| 159 static void SetDelegateForTesting(TestingDelegate* delegate); | 158 static void SetDelegateForTesting(TestingDelegate* delegate); |
| 160 | 159 |
| 161 // Allows for tests to set a file path to print a PDF to. This also initiates | 160 // Allows for tests to set a file path to print a PDF to. This also initiates |
| 162 // the printing without having to click a button on the print preview dialog. | 161 // the printing without having to click a button on the print preview dialog. |
| 163 void SetSelectedFileForTesting(const base::FilePath& path); | 162 void SetSelectedFileForTesting(const base::FilePath& path); |
| 164 | 163 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 194 // title. | 193 // title. |
| 195 base::string16 initiator_title_; | 194 base::string16 initiator_title_; |
| 196 | 195 |
| 197 // Keeps track of whether OnClosePrintPreviewDialog() has been called or not. | 196 // Keeps track of whether OnClosePrintPreviewDialog() has been called or not. |
| 198 bool dialog_closed_; | 197 bool dialog_closed_; |
| 199 | 198 |
| 200 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); | 199 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); |
| 201 }; | 200 }; |
| 202 | 201 |
| 203 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ | 202 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ |
| OLD | NEW |