| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_TEST_TEST_BROWSER_WINDOW_H_ | 5 #ifndef CHROME_TEST_TEST_BROWSER_WINDOW_H_ |
| 6 #define CHROME_TEST_TEST_BROWSER_WINDOW_H_ | 6 #define CHROME_TEST_TEST_BROWSER_WINDOW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/browser_window.h" | 9 #include "chrome/browser/browser_window.h" |
| 10 #include "chrome/browser/views/tabs/tab_strip.h" | 10 #include "chrome/browser/views/tabs/tab_strip.h" |
| 11 | 11 |
| 12 // An implementation of BrowserWindow used for testing. TestBrowserWindow only | 12 // An implementation of BrowserWindow used for testing. TestBrowserWindow only |
| 13 // contains a valid TabStrip, all other getters return NULL. | 13 // contains a valid TabStrip, all other getters return NULL. |
| 14 // See BrowserWithTestWindowTest for an example of using this class. | 14 // See BrowserWithTestWindowTest for an example of using this class. |
| 15 class TestBrowserWindow : public BrowserWindow { | 15 class TestBrowserWindow : public BrowserWindow { |
| 16 public: | 16 public: |
| 17 explicit TestBrowserWindow(Browser* browser) | 17 explicit TestBrowserWindow(Browser* browser) |
| 18 : tab_strip_(browser->tabstrip_model()) { | 18 : tab_strip_(browser->tabstrip_model()) { |
| 19 } | 19 } |
| 20 ~TestBrowserWindow() {} | 20 ~TestBrowserWindow() {} |
| 21 | 21 |
| 22 virtual void Init() {} | 22 virtual void Init() {} |
| 23 virtual void Show() {} | 23 virtual void Show() {} |
| 24 virtual void SetBounds(const gfx::Rect& bounds) {} | 24 virtual void SetBounds(const gfx::Rect& bounds) {} |
| 25 virtual void Close() {} | 25 virtual void Close() {} |
| 26 virtual void Activate() {} | 26 virtual void Activate() {} |
| 27 virtual void FlashFrame() {} | 27 virtual void FlashFrame() {} |
| 28 virtual void* GetNativeHandle() { return NULL; } | 28 virtual void* GetNativeHandle() { return NULL; } |
| 29 virtual BrowserWindowTesting* GetBrowserWindowTesting() { return NULL; } | 29 virtual BrowserWindowTesting* GetBrowserWindowTesting() { return NULL; } |
| 30 virtual TabStrip* GetTabStrip() const { | |
| 31 return const_cast<TabStrip*>(&tab_strip_); | |
| 32 } | |
| 33 virtual StatusBubble* GetStatusBubble() { return NULL; } | 30 virtual StatusBubble* GetStatusBubble() { return NULL; } |
| 34 virtual void SelectedTabToolbarSizeChanged(bool is_animating) {} | 31 virtual void SelectedTabToolbarSizeChanged(bool is_animating) {} |
| 35 virtual void UpdateTitleBar() {} | 32 virtual void UpdateTitleBar() {} |
| 36 virtual void UpdateLoadingAnimations(bool should_animate) {} | 33 virtual void UpdateLoadingAnimations(bool should_animate) {} |
| 34 virtual void SetStarredState(bool is_starred) {} |
| 37 virtual gfx::Rect GetNormalBounds() const { return gfx::Rect(); } | 35 virtual gfx::Rect GetNormalBounds() const { return gfx::Rect(); } |
| 38 virtual bool IsMaximized() { return false; } | 36 virtual bool IsMaximized() { return false; } |
| 39 virtual ToolbarStarToggle* GetStarButton() const { return NULL; } | |
| 40 virtual LocationBarView* GetLocationBarView() const { return NULL; } | 37 virtual LocationBarView* GetLocationBarView() const { return NULL; } |
| 41 virtual GoButton* GetGoButton() const { return NULL; } | |
| 42 virtual BookmarkBarView* GetBookmarkBarView() { return NULL; } | 38 virtual BookmarkBarView* GetBookmarkBarView() { return NULL; } |
| 39 virtual void UpdateStopGoState(bool is_loading) {} |
| 43 virtual void UpdateToolbar(TabContents* contents, | 40 virtual void UpdateToolbar(TabContents* contents, |
| 44 bool should_restore_state) {} | 41 bool should_restore_state) {} |
| 45 virtual void FocusToolbar() {} | 42 virtual void FocusToolbar() {} |
| 46 virtual bool IsBookmarkBarVisible() const { return false; } | 43 virtual bool IsBookmarkBarVisible() const { return false; } |
| 47 virtual void ToggleBookmarkBar() {} | 44 virtual void ToggleBookmarkBar() {} |
| 48 virtual void ShowAboutChromeDialog() {} | 45 virtual void ShowAboutChromeDialog() {} |
| 49 virtual void ShowBookmarkManager() {} | 46 virtual void ShowBookmarkManager() {} |
| 47 virtual bool IsBookmarkBubbleVisible() const { return false; } |
| 48 virtual void ShowBookmarkBubble(const GURL& url, bool already_bookmarked) {} |
| 50 virtual void ShowReportBugDialog() {} | 49 virtual void ShowReportBugDialog() {} |
| 51 virtual void ShowClearBrowsingDataDialog() {} | 50 virtual void ShowClearBrowsingDataDialog() {} |
| 52 virtual void ShowImportDialog() {} | 51 virtual void ShowImportDialog() {} |
| 53 virtual void ShowSearchEnginesDialog() {} | 52 virtual void ShowSearchEnginesDialog() {} |
| 54 virtual void ShowPasswordManager() {} | 53 virtual void ShowPasswordManager() {} |
| 55 virtual void ShowHTMLDialog(HtmlDialogContentsDelegate* delegate, | 54 virtual void ShowHTMLDialog(HtmlDialogContentsDelegate* delegate, |
| 56 void* parent_window) {} | 55 void* parent_window) {} |
| 57 | 56 |
| 58 protected: | 57 protected: |
| 59 virtual void DestroyBrowser() {} | 58 virtual void DestroyBrowser() {} |
| 60 | 59 |
| 61 private: | 60 private: |
| 62 TabStrip tab_strip_; | 61 TabStrip tab_strip_; |
| 63 | 62 |
| 64 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); | 63 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); |
| 65 }; | 64 }; |
| 66 | 65 |
| 67 #endif // CHROME_TEST_TEST_BROWSER_WINDOW_H_ | 66 #endif // CHROME_TEST_TEST_BROWSER_WINDOW_H_ |
| OLD | NEW |