| 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" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // WebContents window since there is no true browser window for unit tests. | 39 // WebContents window since there is no true browser window for unit tests. |
| 40 virtual gfx::NativeView GetHostView() const OVERRIDE { | 40 virtual gfx::NativeView GetHostView() const OVERRIDE { |
| 41 return FindBrowser()->tab_strip_model()->GetActiveWebContents()->GetView()-> | 41 return FindBrowser()->tab_strip_model()->GetActiveWebContents()->GetView()-> |
| 42 GetNativeView(); | 42 GetNativeView(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE { | 45 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE { |
| 46 return gfx::Point(); | 46 return gfx::Point(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 virtual gfx::Size GetMaximumDialogSize() OVERRIDE { |
| 50 return gfx::Size(); |
| 51 } |
| 52 |
| 49 virtual void AddObserver( | 53 virtual void AddObserver( |
| 50 WebContentsModalDialogHostObserver* observer) OVERRIDE {} | 54 WebContentsModalDialogHostObserver* observer) OVERRIDE {} |
| 51 virtual void RemoveObserver( | 55 virtual void RemoveObserver( |
| 52 WebContentsModalDialogHostObserver* observer) OVERRIDE {} | 56 WebContentsModalDialogHostObserver* observer) OVERRIDE {} |
| 53 | 57 |
| 54 private: | 58 private: |
| 55 Browser* FindBrowser() const { | 59 Browser* FindBrowser() const { |
| 56 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 60 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
| 57 Browser* browser = *it; | 61 Browser* browser = *it; |
| 58 if (browser->window() == this) | 62 if (browser->window() == this) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 76 // ShadowingAtExitManager in our base class). | 80 // ShadowingAtExitManager in our base class). |
| 77 content::PluginService::GetInstance()->Init(); | 81 content::PluginService::GetInstance()->Init(); |
| 78 content::PluginService::GetInstance()->DisablePluginsDiscoveryForTesting(); | 82 content::PluginService::GetInstance()->DisablePluginsDiscoveryForTesting(); |
| 79 | 83 |
| 80 profile()->GetPrefs()->SetBoolean(prefs::kPrintPreviewDisabled, false); | 84 profile()->GetPrefs()->SetBoolean(prefs::kPrintPreviewDisabled, false); |
| 81 } | 85 } |
| 82 | 86 |
| 83 BrowserWindow* PrintPreviewTest::CreateBrowserWindow() { | 87 BrowserWindow* PrintPreviewTest::CreateBrowserWindow() { |
| 84 return new PrintPreviewTestBrowserWindow; | 88 return new PrintPreviewTestBrowserWindow; |
| 85 } | 89 } |
| OLD | NEW |