| 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_PRINTING_PRINT_PREVIEW_TEST_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TEST_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TEST_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TEST_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 9 #include "chrome/test/base/browser_with_test_window_test.h" | 10 #include "chrome/test/base/browser_with_test_window_test.h" |
| 11 #include "ui/views/window/dialog_delegate.h" |
| 10 | 12 |
| 11 class PrintPreviewTest : public BrowserWithTestWindowTest { | 13 class PrintPreviewTest : public BrowserWithTestWindowTest { |
| 12 public: | 14 public: |
| 13 PrintPreviewTest(); | 15 PrintPreviewTest(); |
| 14 ~PrintPreviewTest() override; | 16 ~PrintPreviewTest() override; |
| 15 | 17 |
| 16 protected: | 18 protected: |
| 17 void SetUp() override; | 19 void SetUp() override; |
| 18 | 20 |
| 19 // Create a browser window to provide parenting for web contents modal dialog. | 21 // Create a browser window to provide parenting for web contents modal dialog. |
| 20 BrowserWindow* CreateBrowserWindow() override; | 22 BrowserWindow* CreateBrowserWindow() override; |
| 21 | 23 |
| 22 private: | 24 private: |
| 23 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTest); | 25 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTest); |
| 24 }; | 26 }; |
| 25 | 27 |
| 28 #if defined(USE_AURA) |
| 29 class PrintPreviewDialogControllerTest: |
| 30 public printing::PrintPreviewDialogController { |
| 31 public: |
| 32 explicit PrintPreviewDialogControllerTest(gfx::NativeView context); |
| 33 |
| 34 // Need to override the function to get the delegate so that it uses the |
| 35 // correct window. |
| 36 ConstrainedWebDialogDelegate* GetWebDialogDelegate( |
| 37 content::WebContents* initiator) override; |
| 38 |
| 39 void SetContext(gfx::NativeView context); |
| 40 |
| 41 protected: |
| 42 ~PrintPreviewDialogControllerTest() override; |
| 43 |
| 44 private: |
| 45 gfx::NativeView context_; |
| 46 |
| 47 }; |
| 48 #endif // defined(USE_AURA) |
| 49 |
| 26 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TEST_H_ | 50 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TEST_H_ |
| 27 | 51 |
| OLD | NEW |