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_TEST_BASE_TEST_BROWSER_WINDOW_H_ | 5 #ifndef CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ |
6 #define CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ | 6 #define CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // An implementation of BrowserWindow used for testing. TestBrowserWindow only | 23 // An implementation of BrowserWindow used for testing. TestBrowserWindow only |
24 // contains a valid LocationBar, all other getters return NULL. | 24 // contains a valid LocationBar, all other getters return NULL. |
25 // See BrowserWithTestWindowTest for an example of using this class. | 25 // See BrowserWithTestWindowTest for an example of using this class. |
26 class TestBrowserWindow : public BrowserWindow { | 26 class TestBrowserWindow : public BrowserWindow { |
27 public: | 27 public: |
28 TestBrowserWindow(); | 28 TestBrowserWindow(); |
29 virtual ~TestBrowserWindow(); | 29 virtual ~TestBrowserWindow(); |
30 | 30 |
31 // BrowserWindow: | 31 // BrowserWindow: |
32 virtual void Show() OVERRIDE {} | 32 virtual void Show() override {} |
33 virtual void ShowInactive() OVERRIDE {} | 33 virtual void ShowInactive() override {} |
34 virtual void Hide() OVERRIDE {} | 34 virtual void Hide() override {} |
35 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE {} | 35 virtual void SetBounds(const gfx::Rect& bounds) override {} |
36 virtual void Close() OVERRIDE {} | 36 virtual void Close() override {} |
37 virtual void Activate() OVERRIDE {} | 37 virtual void Activate() override {} |
38 virtual void Deactivate() OVERRIDE {} | 38 virtual void Deactivate() override {} |
39 virtual bool IsActive() const OVERRIDE; | 39 virtual bool IsActive() const override; |
40 virtual void FlashFrame(bool flash) OVERRIDE {} | 40 virtual void FlashFrame(bool flash) override {} |
41 virtual bool IsAlwaysOnTop() const OVERRIDE; | 41 virtual bool IsAlwaysOnTop() const override; |
42 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE {} | 42 virtual void SetAlwaysOnTop(bool always_on_top) override {} |
43 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; | 43 virtual gfx::NativeWindow GetNativeWindow() override; |
44 virtual BrowserWindowTesting* GetBrowserWindowTesting() OVERRIDE; | 44 virtual BrowserWindowTesting* GetBrowserWindowTesting() override; |
45 virtual StatusBubble* GetStatusBubble() OVERRIDE; | 45 virtual StatusBubble* GetStatusBubble() override; |
46 virtual void UpdateTitleBar() OVERRIDE {} | 46 virtual void UpdateTitleBar() override {} |
47 virtual void BookmarkBarStateChanged( | 47 virtual void BookmarkBarStateChanged( |
48 BookmarkBar::AnimateChangeType change_type) OVERRIDE {} | 48 BookmarkBar::AnimateChangeType change_type) override {} |
49 virtual void UpdateDevTools() OVERRIDE {} | 49 virtual void UpdateDevTools() override {} |
50 virtual void UpdateLoadingAnimations(bool should_animate) OVERRIDE {} | 50 virtual void UpdateLoadingAnimations(bool should_animate) override {} |
51 virtual void SetStarredState(bool is_starred) OVERRIDE {} | 51 virtual void SetStarredState(bool is_starred) override {} |
52 virtual void SetTranslateIconToggled(bool is_lit) OVERRIDE {} | 52 virtual void SetTranslateIconToggled(bool is_lit) override {} |
53 virtual void OnActiveTabChanged(content::WebContents* old_contents, | 53 virtual void OnActiveTabChanged(content::WebContents* old_contents, |
54 content::WebContents* new_contents, | 54 content::WebContents* new_contents, |
55 int index, | 55 int index, |
56 int reason) OVERRIDE {} | 56 int reason) override {} |
57 virtual void ZoomChangedForActiveTab(bool can_show_bubble) OVERRIDE {} | 57 virtual void ZoomChangedForActiveTab(bool can_show_bubble) override {} |
58 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 58 virtual gfx::Rect GetRestoredBounds() const override; |
59 virtual ui::WindowShowState GetRestoredState() const OVERRIDE; | 59 virtual ui::WindowShowState GetRestoredState() const override; |
60 virtual gfx::Rect GetBounds() const OVERRIDE; | 60 virtual gfx::Rect GetBounds() const override; |
61 virtual bool IsMaximized() const OVERRIDE; | 61 virtual bool IsMaximized() const override; |
62 virtual bool IsMinimized() const OVERRIDE; | 62 virtual bool IsMinimized() const override; |
63 virtual void Maximize() OVERRIDE {} | 63 virtual void Maximize() override {} |
64 virtual void Minimize() OVERRIDE {} | 64 virtual void Minimize() override {} |
65 virtual void Restore() OVERRIDE {} | 65 virtual void Restore() override {} |
66 virtual void EnterFullscreen( | 66 virtual void EnterFullscreen( |
67 const GURL& url, FullscreenExitBubbleType type) OVERRIDE {} | 67 const GURL& url, FullscreenExitBubbleType type) override {} |
68 virtual void ExitFullscreen() OVERRIDE {} | 68 virtual void ExitFullscreen() override {} |
69 virtual void UpdateFullscreenExitBubbleContent( | 69 virtual void UpdateFullscreenExitBubbleContent( |
70 const GURL& url, | 70 const GURL& url, |
71 FullscreenExitBubbleType bubble_type) OVERRIDE {} | 71 FullscreenExitBubbleType bubble_type) override {} |
72 virtual bool ShouldHideUIForFullscreen() const OVERRIDE; | 72 virtual bool ShouldHideUIForFullscreen() const override; |
73 virtual bool IsFullscreen() const OVERRIDE; | 73 virtual bool IsFullscreen() const override; |
74 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
75 virtual void SetMetroSnapMode(bool enable) OVERRIDE {} | 75 virtual void SetMetroSnapMode(bool enable) override {} |
76 virtual bool IsInMetroSnapMode() const; | 76 virtual bool IsInMetroSnapMode() const; |
77 #endif | 77 #endif |
78 virtual bool IsFullscreenBubbleVisible() const OVERRIDE; | 78 virtual bool IsFullscreenBubbleVisible() const override; |
79 virtual LocationBar* GetLocationBar() const OVERRIDE; | 79 virtual LocationBar* GetLocationBar() const override; |
80 virtual void SetFocusToLocationBar(bool select_all) OVERRIDE {} | 80 virtual void SetFocusToLocationBar(bool select_all) override {} |
81 virtual void UpdateReloadStopState(bool is_loading, bool force) OVERRIDE {} | 81 virtual void UpdateReloadStopState(bool is_loading, bool force) override {} |
82 virtual void UpdateToolbar(content::WebContents* contents) OVERRIDE {} | 82 virtual void UpdateToolbar(content::WebContents* contents) override {} |
83 virtual void FocusToolbar() OVERRIDE {} | 83 virtual void FocusToolbar() override {} |
84 virtual void FocusAppMenu() OVERRIDE {} | 84 virtual void FocusAppMenu() override {} |
85 virtual void FocusBookmarksToolbar() OVERRIDE {} | 85 virtual void FocusBookmarksToolbar() override {} |
86 virtual void FocusInfobars() OVERRIDE {} | 86 virtual void FocusInfobars() override {} |
87 virtual void RotatePaneFocus(bool forwards) OVERRIDE {} | 87 virtual void RotatePaneFocus(bool forwards) override {} |
88 virtual void ShowAppMenu() OVERRIDE {} | 88 virtual void ShowAppMenu() override {} |
89 virtual bool PreHandleKeyboardEvent( | 89 virtual bool PreHandleKeyboardEvent( |
90 const content::NativeWebKeyboardEvent& event, | 90 const content::NativeWebKeyboardEvent& event, |
91 bool* is_keyboard_shortcut) OVERRIDE; | 91 bool* is_keyboard_shortcut) override; |
92 virtual void HandleKeyboardEvent( | 92 virtual void HandleKeyboardEvent( |
93 const content::NativeWebKeyboardEvent& event) OVERRIDE {} | 93 const content::NativeWebKeyboardEvent& event) override {} |
94 | 94 |
95 virtual bool IsBookmarkBarVisible() const OVERRIDE; | 95 virtual bool IsBookmarkBarVisible() const override; |
96 virtual bool IsBookmarkBarAnimating() const OVERRIDE; | 96 virtual bool IsBookmarkBarAnimating() const override; |
97 virtual bool IsTabStripEditable() const OVERRIDE; | 97 virtual bool IsTabStripEditable() const override; |
98 virtual bool IsToolbarVisible() const OVERRIDE; | 98 virtual bool IsToolbarVisible() const override; |
99 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; | 99 virtual gfx::Rect GetRootWindowResizerRect() const override; |
100 virtual void ConfirmAddSearchProvider(TemplateURL* template_url, | 100 virtual void ConfirmAddSearchProvider(TemplateURL* template_url, |
101 Profile* profile) OVERRIDE {} | 101 Profile* profile) override {} |
102 virtual void ShowUpdateChromeDialog() OVERRIDE {} | 102 virtual void ShowUpdateChromeDialog() override {} |
103 virtual void ShowBookmarkBubble(const GURL& url, | 103 virtual void ShowBookmarkBubble(const GURL& url, |
104 bool already_bookmarked) OVERRIDE {} | 104 bool already_bookmarked) override {} |
105 virtual void ShowBookmarkAppBubble( | 105 virtual void ShowBookmarkAppBubble( |
106 const WebApplicationInfo& web_app_info, | 106 const WebApplicationInfo& web_app_info, |
107 const std::string& extension_id) OVERRIDE {} | 107 const std::string& extension_id) override {} |
108 virtual void ShowTranslateBubble( | 108 virtual void ShowTranslateBubble( |
109 content::WebContents* contents, | 109 content::WebContents* contents, |
110 translate::TranslateStep step, | 110 translate::TranslateStep step, |
111 translate::TranslateErrors::Type error_type, | 111 translate::TranslateErrors::Type error_type, |
112 bool is_user_gesture) OVERRIDE {} | 112 bool is_user_gesture) override {} |
113 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 113 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
114 virtual void ShowOneClickSigninBubble( | 114 virtual void ShowOneClickSigninBubble( |
115 OneClickSigninBubbleType type, | 115 OneClickSigninBubbleType type, |
116 const base::string16& email, | 116 const base::string16& email, |
117 const base::string16& error_message, | 117 const base::string16& error_message, |
118 const StartSyncCallback& start_sync_callback) OVERRIDE {} | 118 const StartSyncCallback& start_sync_callback) override {} |
119 #endif | 119 #endif |
120 virtual bool IsDownloadShelfVisible() const OVERRIDE; | 120 virtual bool IsDownloadShelfVisible() const override; |
121 virtual DownloadShelf* GetDownloadShelf() OVERRIDE; | 121 virtual DownloadShelf* GetDownloadShelf() override; |
122 virtual void ConfirmBrowserCloseWithPendingDownloads( | 122 virtual void ConfirmBrowserCloseWithPendingDownloads( |
123 int download_count, | 123 int download_count, |
124 Browser::DownloadClosePreventionType dialog_type, | 124 Browser::DownloadClosePreventionType dialog_type, |
125 bool app_modal, | 125 bool app_modal, |
126 const base::Callback<void(bool)>& callback) OVERRIDE {} | 126 const base::Callback<void(bool)>& callback) override {} |
127 virtual void UserChangedTheme() OVERRIDE {} | 127 virtual void UserChangedTheme() override {} |
128 virtual int GetExtraRenderViewHeight() const OVERRIDE; | 128 virtual int GetExtraRenderViewHeight() const override; |
129 virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE {} | 129 virtual void WebContentsFocused(content::WebContents* contents) override {} |
130 virtual void ShowWebsiteSettings(Profile* profile, | 130 virtual void ShowWebsiteSettings(Profile* profile, |
131 content::WebContents* web_contents, | 131 content::WebContents* web_contents, |
132 const GURL& url, | 132 const GURL& url, |
133 const content::SSLStatus& ssl) OVERRIDE {} | 133 const content::SSLStatus& ssl) override {} |
134 virtual void Cut() OVERRIDE {} | 134 virtual void Cut() override {} |
135 virtual void Copy() OVERRIDE {} | 135 virtual void Copy() override {} |
136 virtual void Paste() OVERRIDE {} | 136 virtual void Paste() override {} |
137 #if defined(OS_MACOSX) | 137 #if defined(OS_MACOSX) |
138 virtual void EnterFullscreenWithChrome() OVERRIDE {} | 138 virtual void EnterFullscreenWithChrome() override {} |
139 virtual bool IsFullscreenWithChrome() OVERRIDE; | 139 virtual bool IsFullscreenWithChrome() override; |
140 virtual bool IsFullscreenWithoutChrome() OVERRIDE; | 140 virtual bool IsFullscreenWithoutChrome() override; |
141 #endif | 141 #endif |
142 | 142 |
143 virtual WindowOpenDisposition GetDispositionForPopupBounds( | 143 virtual WindowOpenDisposition GetDispositionForPopupBounds( |
144 const gfx::Rect& bounds) OVERRIDE; | 144 const gfx::Rect& bounds) override; |
145 virtual FindBar* CreateFindBar() OVERRIDE; | 145 virtual FindBar* CreateFindBar() override; |
146 virtual web_modal::WebContentsModalDialogHost* | 146 virtual web_modal::WebContentsModalDialogHost* |
147 GetWebContentsModalDialogHost() OVERRIDE; | 147 GetWebContentsModalDialogHost() override; |
148 virtual void ShowAvatarBubble(content::WebContents* web_contents, | 148 virtual void ShowAvatarBubble(content::WebContents* web_contents, |
149 const gfx::Rect& rect) OVERRIDE {} | 149 const gfx::Rect& rect) override {} |
150 virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode, | 150 virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode, |
151 const signin::ManageAccountsParams& manage_accounts_params) OVERRIDE {} | 151 const signin::ManageAccountsParams& manage_accounts_params) override {} |
152 virtual int GetRenderViewHeightInsetWithDetachedBookmarkBar() OVERRIDE; | 152 virtual int GetRenderViewHeightInsetWithDetachedBookmarkBar() override; |
153 virtual void ExecuteExtensionCommand( | 153 virtual void ExecuteExtensionCommand( |
154 const extensions::Extension* extension, | 154 const extensions::Extension* extension, |
155 const extensions::Command& command) OVERRIDE; | 155 const extensions::Command& command) override; |
156 | 156 |
157 protected: | 157 protected: |
158 virtual void DestroyBrowser() OVERRIDE {} | 158 virtual void DestroyBrowser() override {} |
159 | 159 |
160 private: | 160 private: |
161 class TestLocationBar : public LocationBar { | 161 class TestLocationBar : public LocationBar { |
162 public: | 162 public: |
163 TestLocationBar() : LocationBar(NULL) {} | 163 TestLocationBar() : LocationBar(NULL) {} |
164 virtual ~TestLocationBar() {} | 164 virtual ~TestLocationBar() {} |
165 | 165 |
166 // LocationBar: | 166 // LocationBar: |
167 virtual void ShowFirstRunBubble() OVERRIDE {} | 167 virtual void ShowFirstRunBubble() override {} |
168 virtual GURL GetDestinationURL() const OVERRIDE; | 168 virtual GURL GetDestinationURL() const override; |
169 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; | 169 virtual WindowOpenDisposition GetWindowOpenDisposition() const override; |
170 virtual ui::PageTransition GetPageTransition() const OVERRIDE; | 170 virtual ui::PageTransition GetPageTransition() const override; |
171 virtual void AcceptInput() OVERRIDE {} | 171 virtual void AcceptInput() override {} |
172 virtual void FocusLocation(bool select_all) OVERRIDE {} | 172 virtual void FocusLocation(bool select_all) override {} |
173 virtual void FocusSearch() OVERRIDE {} | 173 virtual void FocusSearch() override {} |
174 virtual void UpdateContentSettingsIcons() OVERRIDE {} | 174 virtual void UpdateContentSettingsIcons() override {} |
175 virtual void UpdateManagePasswordsIconAndBubble() OVERRIDE {} | 175 virtual void UpdateManagePasswordsIconAndBubble() override {} |
176 virtual void UpdatePageActions() OVERRIDE {} | 176 virtual void UpdatePageActions() override {} |
177 virtual void InvalidatePageActions() OVERRIDE {} | 177 virtual void InvalidatePageActions() override {} |
178 virtual void UpdateBookmarkStarVisibility() OVERRIDE {} | 178 virtual void UpdateBookmarkStarVisibility() override {} |
179 virtual bool ShowPageActionPopup(const extensions::Extension* extension, | 179 virtual bool ShowPageActionPopup(const extensions::Extension* extension, |
180 bool grant_active_tab) OVERRIDE; | 180 bool grant_active_tab) override; |
181 virtual void UpdateOpenPDFInReaderPrompt() OVERRIDE {} | 181 virtual void UpdateOpenPDFInReaderPrompt() override {} |
182 virtual void UpdateGeneratedCreditCardView() OVERRIDE {} | 182 virtual void UpdateGeneratedCreditCardView() override {} |
183 virtual void SaveStateToContents(content::WebContents* contents) OVERRIDE {} | 183 virtual void SaveStateToContents(content::WebContents* contents) override {} |
184 virtual void Revert() OVERRIDE {} | 184 virtual void Revert() override {} |
185 virtual const OmniboxView* GetOmniboxView() const OVERRIDE; | 185 virtual const OmniboxView* GetOmniboxView() const override; |
186 virtual OmniboxView* GetOmniboxView() OVERRIDE; | 186 virtual OmniboxView* GetOmniboxView() override; |
187 virtual LocationBarTesting* GetLocationBarForTesting() OVERRIDE; | 187 virtual LocationBarTesting* GetLocationBarForTesting() override; |
188 | 188 |
189 private: | 189 private: |
190 DISALLOW_COPY_AND_ASSIGN(TestLocationBar); | 190 DISALLOW_COPY_AND_ASSIGN(TestLocationBar); |
191 }; | 191 }; |
192 | 192 |
193 TestDownloadShelf download_shelf_; | 193 TestDownloadShelf download_shelf_; |
194 TestLocationBar location_bar_; | 194 TestLocationBar location_bar_; |
195 | 195 |
196 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); | 196 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); |
197 }; | 197 }; |
198 | 198 |
199 namespace chrome { | 199 namespace chrome { |
200 | 200 |
201 // Helper that handle the lifetime of TestBrowserWindow instances. | 201 // Helper that handle the lifetime of TestBrowserWindow instances. |
202 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params); | 202 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params); |
203 | 203 |
204 } // namespace chrome | 204 } // namespace chrome |
205 | 205 |
206 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ | 206 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ |
OLD | NEW |