| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" |
| 10 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 13 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 14 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
| 14 | 15 |
| 15 class PrintPreviewDataService; | 16 class PrintPreviewDataService; |
| 16 class PrintPreviewHandler; | 17 class PrintPreviewHandler; |
| 17 struct PrintHostMsg_DidGetPreviewPageCount_Params; | 18 struct PrintHostMsg_DidGetPreviewPageCount_Params; |
| 18 struct PrintHostMsg_RequestPrintPreview_Params; | 19 struct PrintHostMsg_RequestPrintPreview_Params; |
| 19 | 20 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 virtual void DidGetPreviewPageCount(int page_count) = 0; | 153 virtual void DidGetPreviewPageCount(int page_count) = 0; |
| 153 virtual void DidRenderPreviewPage(content::WebContents* preview_dialog) = 0; | 154 virtual void DidRenderPreviewPage(content::WebContents* preview_dialog) = 0; |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 static void SetDelegateForTesting(TestingDelegate* delegate); | 157 static void SetDelegateForTesting(TestingDelegate* delegate); |
| 157 | 158 |
| 158 // Allows for tests to set a file path to print a PDF to. This also initiates | 159 // Allows for tests to set a file path to print a PDF to. This also initiates |
| 159 // the printing without having to click a button on the print preview dialog. | 160 // the printing without having to click a button on the print preview dialog. |
| 160 void SetSelectedFileForTesting(const base::FilePath& path); | 161 void SetSelectedFileForTesting(const base::FilePath& path); |
| 161 | 162 |
| 163 // Passes |closure| to PrintPreviewHandler::SetPdfSavedClosureForTesting(). |
| 164 void SetPdfSavedClosureForTesting(const base::Closure& closure); |
| 165 |
| 162 private: | 166 private: |
| 163 friend class PrintPreviewHandlerTest; | 167 friend class PrintPreviewHandlerTest; |
| 164 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsCustom); | 168 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsCustom); |
| 165 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsDefault); | 169 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsDefault); |
| 166 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, | 170 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, |
| 167 StickyMarginsCustomThenDefault); | 171 StickyMarginsCustomThenDefault); |
| 168 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, | 172 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, |
| 169 GetLastUsedMarginSettingsCustom); | 173 GetLastUsedMarginSettingsCustom); |
| 170 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, | 174 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, |
| 171 GetLastUsedMarginSettingsDefault); | 175 GetLastUsedMarginSettingsDefault); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 197 // title. | 201 // title. |
| 198 base::string16 initiator_title_; | 202 base::string16 initiator_title_; |
| 199 | 203 |
| 200 // Keeps track of whether OnClosePrintPreviewDialog() has been called or not. | 204 // Keeps track of whether OnClosePrintPreviewDialog() has been called or not. |
| 201 bool dialog_closed_; | 205 bool dialog_closed_; |
| 202 | 206 |
| 203 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); | 207 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); |
| 204 }; | 208 }; |
| 205 | 209 |
| 206 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ | 210 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ |
| OLD | NEW |