Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_ui.h

Issue 335583004: Added a test that currently is able to print to pdf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored print_preview.js and the browsertest. Made browsertest multiplatform compatible. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 public: 149 public:
150 virtual bool IsAutoCancelEnabled() = 0; 150 virtual bool IsAutoCancelEnabled() = 0;
151 virtual void DidGetPreviewPageCount(int page_count) = 0; 151 virtual void DidGetPreviewPageCount(int page_count) = 0;
152 virtual void DidRenderPreviewPage(content::WebContents* preview_dialog) = 0; 152 virtual void DidRenderPreviewPage(content::WebContents* preview_dialog) = 0;
153 }; 153 };
154 154
155 static void SetDelegateForTesting(TestingDelegate* delegate); 155 static void SetDelegateForTesting(TestingDelegate* delegate);
156 156
157 private: 157 private:
158 friend class PrintPreviewHandlerTest; 158 friend class PrintPreviewHandlerTest;
159 friend class PrintPreviewPdfGeneratedBrowserTest;
159 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsCustom); 160 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsCustom);
160 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsDefault); 161 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsDefault);
161 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, 162 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest,
162 StickyMarginsCustomThenDefault); 163 StickyMarginsCustomThenDefault);
163 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, 164 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest,
164 GetLastUsedMarginSettingsCustom); 165 GetLastUsedMarginSettingsCustom);
165 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, 166 FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest,
166 GetLastUsedMarginSettingsDefault); 167 GetLastUsedMarginSettingsDefault);
167 FRIEND_TEST_ALL_PREFIXES(PrintPreviewDialogControllerUnitTest, 168 FRIEND_TEST_ALL_PREFIXES(PrintPreviewDialogControllerUnitTest,
168 TitleAfterReload); 169 TitleAfterReload);
170 FRIEND_TEST_ALL_PREFIXES(PrintPreviewPdfGeneratedBrowserTest,
Lei Zhang 2014/07/08 01:11:37 Maybe just add a public SetSelectedFileForTesting
171 DummyTest);
169 172
170 // Returns the Singleton instance of the PrintPreviewDataService. 173 // Returns the Singleton instance of the PrintPreviewDataService.
171 PrintPreviewDataService* print_preview_data_service(); 174 PrintPreviewDataService* print_preview_data_service();
172 175
173 base::TimeTicks initial_preview_start_time_; 176 base::TimeTicks initial_preview_start_time_;
174 177
175 // The unique ID for this class instance. Stored here to avoid calling 178 // The unique ID for this class instance. Stored here to avoid calling
176 // GetIDForPrintPreviewUI() everywhere. 179 // GetIDForPrintPreviewUI() everywhere.
177 const int32 id_; 180 const int32 id_;
178 181
(...skipping 13 matching lines...) Expand all
192 // title. 195 // title.
193 base::string16 initiator_title_; 196 base::string16 initiator_title_;
194 197
195 // Keeps track of whether OnClosePrintPreviewDialog() has been called or not. 198 // Keeps track of whether OnClosePrintPreviewDialog() has been called or not.
196 bool dialog_closed_; 199 bool dialog_closed_;
197 200
198 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); 201 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI);
199 }; 202 };
200 203
201 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ 204 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698