| 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 #include "chrome/browser/printing/print_preview_test.h" | 5 #include "chrome/browser/printing/print_preview_test.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_iterator.h" | 9 #include "chrome/browser/ui/browser_iterator.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 11 #include "chrome/browser/ui/web_contents_modal_dialog_host.h" | |
| 12 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 13 #include "chrome/test/base/test_browser_window.h" | 12 #include "chrome/test/base/test_browser_window.h" |
| 13 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 14 #include "content/public/browser/plugin_service.h" | 14 #include "content/public/browser/plugin_service.h" |
| 15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 16 #include "content/public/browser/web_contents_view.h" | 16 #include "content/public/browser/web_contents_view.h" |
| 17 | 17 |
| 18 using web_modal::WebContentsModalDialogHost; |
| 19 using web_modal::WebContentsModalDialogHostObserver; |
| 20 |
| 18 namespace { | 21 namespace { |
| 19 | 22 |
| 20 // Use a custom test browser window to provide a parent view to the print | 23 // Use a custom test browser window to provide a parent view to the print |
| 21 // preview dialog. | 24 // preview dialog. |
| 22 class PrintPreviewTestBrowserWindow | 25 class PrintPreviewTestBrowserWindow |
| 23 : public TestBrowserWindow, | 26 : public TestBrowserWindow, |
| 24 public WebContentsModalDialogHost { | 27 public WebContentsModalDialogHost { |
| 25 public: | 28 public: |
| 26 PrintPreviewTestBrowserWindow() {} | 29 PrintPreviewTestBrowserWindow() {} |
| 27 | 30 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // ShadowingAtExitManager in our base class). | 78 // ShadowingAtExitManager in our base class). |
| 76 content::PluginService::GetInstance()->SetPluginListForTesting( | 79 content::PluginService::GetInstance()->SetPluginListForTesting( |
| 77 &plugin_list_); | 80 &plugin_list_); |
| 78 | 81 |
| 79 profile()->GetPrefs()->SetBoolean(prefs::kPrintPreviewDisabled, false); | 82 profile()->GetPrefs()->SetBoolean(prefs::kPrintPreviewDisabled, false); |
| 80 } | 83 } |
| 81 | 84 |
| 82 BrowserWindow* PrintPreviewTest::CreateBrowserWindow() { | 85 BrowserWindow* PrintPreviewTest::CreateBrowserWindow() { |
| 83 return new PrintPreviewTestBrowserWindow; | 86 return new PrintPreviewTestBrowserWindow; |
| 84 } | 87 } |
| OLD | NEW |