blob: c02146c4142eda5a524ff7bc35b1acf77fb73461 [file] [log] [blame]
[email protected]e41982a72012-11-20 07:16:511// Copyright 2012 The Chromium Authors. All rights reserved.
[email protected]69b04b92010-11-08 22:12:182// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_UI_BROWSER_WINDOW_H_
6#define CHROME_BROWSER_UI_BROWSER_WINDOW_H_
[email protected]69b04b92010-11-08 22:12:187
[email protected]fe54b4a2012-03-28 16:11:048#include "base/callback_forward.h"
[email protected]2e9d79f2013-08-16 05:45:569#include "chrome/browser/lifetime/browser_close_manager.h"
[email protected]bccf5ab2014-02-15 08:20:3010#include "chrome/browser/translate/translate_tab_helper.h"
[email protected]09b29342011-06-24 19:18:4811#include "chrome/browser/ui/bookmarks/bookmark_bar.h"
[email protected]edfca702013-08-16 08:58:1412#include "chrome/browser/ui/browser.h"
[email protected]9d5c059a82012-06-29 20:13:0713#include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h"
[email protected]ddeb0e8432012-12-21 07:27:5414#include "chrome/browser/ui/host_desktop.h"
[email protected]e4b66bf2012-05-29 20:39:5115#include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
[email protected]69b04b92010-11-08 22:12:1816#include "chrome/common/content_settings_types.h"
[email protected]eba93c92014-01-07 17:34:1717#include "components/translate/core/common/translate_errors.h"
[email protected]5f39adc2013-05-23 11:50:4618#include "ui/base/base_window.h"
[email protected]f47621b2013-01-22 20:50:3319#include "ui/base/window_open_disposition.h"
[email protected]08397d52011-02-05 01:53:3820#include "ui/gfx/native_widget_types.h"
[email protected]69b04b92010-11-08 22:12:1821
22class Browser;
23class BrowserWindowTesting;
24class DownloadShelf;
25class FindBar;
26class GURL;
[email protected]69b04b92010-11-08 22:12:1827class LocationBar;
28class Profile;
29class StatusBubble;
[email protected]69b04b92010-11-08 22:12:1830class TemplateURL;
[email protected]69b04b92010-11-08 22:12:1831#if !defined(OS_MACOSX)
32class ToolbarView;
33#endif
[email protected]69b04b92010-11-08 22:12:1834
[email protected]46601462014-02-04 11:08:5035struct WebApplicationInfo;
36
[email protected]e0f90fc2012-06-06 19:30:1037namespace autofill {
38class PasswordGenerator;
[email protected]e620d362013-09-09 08:01:5339struct PasswordForm;
[email protected]e0f90fc2012-06-06 19:30:1040}
[email protected]ea049a02011-12-25 21:37:0941namespace content {
42class WebContents;
[email protected]b87ee522012-05-18 15:16:5443struct NativeWebKeyboardEvent;
[email protected]d583e3f22011-12-27 21:38:1744struct SSLStatus;
[email protected]ea049a02011-12-25 21:37:0945}
46
[email protected]1c321ee2012-05-21 03:02:3447namespace extensions {
48class Extension;
49}
50
[email protected]69b04b92010-11-08 22:12:1851namespace gfx {
52class Rect;
[email protected]0548c5352011-09-07 00:33:3353class Size;
[email protected]69b04b92010-11-08 22:12:1854}
55
[email protected]e41d0082013-05-16 04:37:5456namespace web_modal {
57class WebContentsModalDialogHost;
58}
59
[email protected]69b04b92010-11-08 22:12:1860////////////////////////////////////////////////////////////////////////////////
61// BrowserWindow interface
62// An interface implemented by the "view" of the Browser window.
[email protected]5f39adc2013-05-23 11:50:4663// This interface includes ui::BaseWindow methods as well as Browser window
[email protected]41d9faf2012-02-28 23:46:0264// specific methods.
[email protected]69b04b92010-11-08 22:12:1865//
66// NOTE: All getters may return NULL.
[email protected]41d9faf2012-02-28 23:46:0267//
[email protected]5f39adc2013-05-23 11:50:4668class BrowserWindow : public ui::BaseWindow {
[email protected]69b04b92010-11-08 22:12:1869 public:
[email protected]ed2f27132011-04-04 17:19:5770 virtual ~BrowserWindow() {}
71
[email protected]41d9faf2012-02-28 23:46:0272 //////////////////////////////////////////////////////////////////////////////
[email protected]5f39adc2013-05-23 11:50:4673 // ui::BaseWindow interface notes:
[email protected]69b04b92010-11-08 22:12:1874
[email protected]41d9faf2012-02-28 23:46:0275 // Closes the window as soon as possible. If the window is not in a drag
[email protected]69b04b92010-11-08 22:12:1876 // session, it will close immediately; otherwise, it will move offscreen (so
77 // events are still fired) until the drag ends, then close. This assumes
78 // that the Browser is not immediately destroyed, but will be eventually
79 // destroyed by other means (eg, the tab strip going to zero elements).
80 // Bad things happen if the Browser dtor is called directly as a result of
81 // invoking this method.
[email protected]41d9faf2012-02-28 23:46:0282 // virtual void Close() = 0;
[email protected]69b04b92010-11-08 22:12:1883
[email protected]41d9faf2012-02-28 23:46:0284 // Browser::OnWindowDidShow should be called after showing the window.
85 // virtual void Show() = 0;
[email protected]69b04b92010-11-08 22:12:1886
[email protected]41d9faf2012-02-28 23:46:0287 //////////////////////////////////////////////////////////////////////////////
88 // Browser specific methods:
[email protected]69b04b92010-11-08 22:12:1889
[email protected]69b04b92010-11-08 22:12:1890 // Returns a pointer to the testing interface to the Browser window, or NULL
91 // if there is none.
92 virtual BrowserWindowTesting* GetBrowserWindowTesting() = 0;
93
94 // Return the status bubble associated with the frame
95 virtual StatusBubble* GetStatusBubble() = 0;
96
[email protected]69b04b92010-11-08 22:12:1897 // Inform the frame that the selected tab favicon or title has changed. Some
98 // frames may need to refresh their title bar.
99 virtual void UpdateTitleBar() = 0;
100
[email protected]09b29342011-06-24 19:18:48101 // Invoked when the state of the bookmark bar changes. This is only invoked if
102 // the state changes for the current tab, it is not sent when switching tabs.
103 virtual void BookmarkBarStateChanged(
104 BookmarkBar::AnimateChangeType change_type) = 0;
[email protected]69b04b92010-11-08 22:12:18105
106 // Inform the frame that the dev tools window for the selected tab has
107 // changed.
108 virtual void UpdateDevTools() = 0;
109
110 // Update any loading animations running in the window. |should_animate| is
111 // true if there are tabs loading and the animations should continue, false
112 // if there are no active loads and the animations should end.
113 virtual void UpdateLoadingAnimations(bool should_animate) = 0;
114
115 // Sets the starred state for the current tab.
116 virtual void SetStarredState(bool is_starred) = 0;
117
[email protected]3917f82a2013-11-21 06:25:54118 // Sets whether the translate icon is lit for the current tab.
119 virtual void SetTranslateIconToggled(bool is_lit) = 0;
120
[email protected]08726d5e2013-09-24 21:52:55121 // Called when the active tab changes. Subclasses which implement
122 // TabStripModelObserver should implement this instead of ActiveTabChanged();
123 // the Browser will call this method while processing that one.
124 virtual void OnActiveTabChanged(content::WebContents* old_contents,
125 content::WebContents* new_contents,
126 int index,
127 int reason) = 0;
128
[email protected]5423c372012-08-22 05:50:16129 // Called to force the zoom state to for the active tab to be recalculated.
130 // |can_show_bubble| is true when a user presses the zoom up or down keyboard
131 // shortcuts and will be false in other cases (e.g. switching tabs, "clicking"
132 // + or - in the wrench menu to change zoom).
133 virtual void ZoomChangedForActiveTab(bool can_show_bubble) = 0;
[email protected]6f80e932012-06-04 19:00:07134
[email protected]69b04b92010-11-08 22:12:18135 // Accessors for fullscreen mode state.
[email protected]8d944b32011-10-17 06:11:53136 virtual void EnterFullscreen(const GURL& url,
137 FullscreenExitBubbleType bubble_type) = 0;
[email protected]55c87fa2011-10-15 07:28:28138 virtual void ExitFullscreen() = 0;
[email protected]8d944b32011-10-17 06:11:53139 virtual void UpdateFullscreenExitBubbleContent(
140 const GURL& url,
141 FullscreenExitBubbleType bubble_type) = 0;
[email protected]69b04b92010-11-08 22:12:18142
[email protected]6a414ff2013-02-27 08:22:54143 // Windows and GTK remove the top controls in fullscreen, but Mac and Ash
144 // keep the controls in a slide-down panel.
145 virtual bool ShouldHideUIForFullscreen() const = 0;
146
[email protected]69b04b92010-11-08 22:12:18147 // Returns true if the fullscreen bubble is visible.
148 virtual bool IsFullscreenBubbleVisible() const = 0;
149
[email protected]77cbe50e2012-06-14 02:44:38150#if defined(OS_WIN)
151 // Sets state for entering or exiting Win8 Metro snap mode.
152 virtual void SetMetroSnapMode(bool enable) = 0;
153
154 // Returns whether the window is currently in Win8 Metro snap mode.
155 virtual bool IsInMetroSnapMode() const = 0;
156#endif
157
[email protected]69b04b92010-11-08 22:12:18158 // Returns the location bar.
159 virtual LocationBar* GetLocationBar() const = 0;
160
161 // Tries to focus the location bar. Clears the window focus (to avoid
162 // inconsistent state) if this fails.
163 virtual void SetFocusToLocationBar(bool select_all) = 0;
164
165 // Informs the view whether or not a load is in progress for the current tab.
166 // The view can use this notification to update the reload/stop button.
167 virtual void UpdateReloadStopState(bool is_loading, bool force) = 0;
168
169 // Updates the toolbar with the state for the specified |contents|.
[email protected]2e7fe4312013-08-21 17:19:48170 virtual void UpdateToolbar(content::WebContents* contents) = 0;
[email protected]69b04b92010-11-08 22:12:18171
172 // Focuses the toolbar (for accessibility).
173 virtual void FocusToolbar() = 0;
174
175 // Focuses the app menu like it was a menu bar.
176 //
177 // Not used on the Mac, which has a "normal" menu bar.
178 virtual void FocusAppMenu() = 0;
179
180 // Focuses the bookmarks toolbar (for accessibility).
181 virtual void FocusBookmarksToolbar() = 0;
182
[email protected]822ca8c62013-04-19 00:49:15183 // Focuses an infobar, if shown (for accessibility).
184 virtual void FocusInfobars() = 0;
185
[email protected]69b04b92010-11-08 22:12:18186 // Moves keyboard focus to the next pane.
187 virtual void RotatePaneFocus(bool forwards) = 0;
188
189 // Returns whether the bookmark bar is visible or not.
190 virtual bool IsBookmarkBarVisible() const = 0;
191
192 // Returns whether the bookmark bar is animating or not.
193 virtual bool IsBookmarkBarAnimating() const = 0;
194
[email protected]95bf8a5b2010-12-22 16:04:07195 // Returns whether the tab strip is editable (for extensions).
196 virtual bool IsTabStripEditable() const = 0;
197
[email protected]69b04b92010-11-08 22:12:18198 // Returns whether the tool bar is visible or not.
199 virtual bool IsToolbarVisible() const = 0;
200
[email protected]b7a756d42012-01-23 18:08:17201 // Returns the rect where the resize corner should be drawn by the render
202 // widget host view (on top of what the renderer returns). We return an empty
203 // rect to identify that there shouldn't be a resize corner (in the cases
204 // where we take care of it ourselves at the browser level).
205 virtual gfx::Rect GetRootWindowResizerRect() const = 0;
206
[email protected]69b04b92010-11-08 22:12:18207 // Shows a confirmation dialog box for adding a search engine described by
208 // |template_url|. Takes ownership of |template_url|.
[email protected]3613347d2012-04-27 20:27:37209 virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
[email protected]69b04b92010-11-08 22:12:18210 Profile* profile) = 0;
211
[email protected]69b04b92010-11-08 22:12:18212 // Shows the Update Recommended dialog box.
213 virtual void ShowUpdateChromeDialog() = 0;
214
[email protected]69b04b92010-11-08 22:12:18215 // Shows the Bookmark bubble. |url| is the URL being bookmarked,
216 // |already_bookmarked| is true if the url is already bookmarked.
217 virtual void ShowBookmarkBubble(const GURL& url, bool already_bookmarked) = 0;
218
[email protected]46601462014-02-04 11:08:50219 // Shows the Bookmark App bubble.
220 // See Extension::InitFromValueFlags::FROM_BOOKMARK for a description of
221 // bookmark apps.
222 //
223 // |web_app_info| is the WebApplicationInfo being converted into an app.
224 // |extension_id| is the id of the bookmark app.
225 virtual void ShowBookmarkAppBubble(const WebApplicationInfo& web_app_info,
226 const std::string& extension_id) = 0;
227
[email protected]195c99c2012-10-31 06:24:51228 // Shows the bookmark prompt.
229 // TODO(yosin): Make ShowBookmarkPrompt pure virtual.
230 virtual void ShowBookmarkPrompt() {}
231
[email protected]e625b7602013-10-28 09:24:56232 // Shows the translate bubble.
[email protected]bccf5ab2014-02-15 08:20:30233 virtual void ShowTranslateBubble(content::WebContents* contents,
234 TranslateTabHelper::TranslateStep step,
235 TranslateErrors::Type error_type) = 0;
[email protected]e625b7602013-10-28 09:24:56236
[email protected]235a0562012-03-26 22:22:35237#if defined(ENABLE_ONE_CLICK_SIGNIN)
[email protected]265c9272013-01-25 19:18:45238 enum OneClickSigninBubbleType {
239 ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE,
[email protected]0cf5d282013-04-12 18:33:12240 ONE_CLICK_SIGNIN_BUBBLE_TYPE_MODAL_DIALOG,
241 ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG
[email protected]265c9272013-01-25 19:18:45242 };
243
[email protected]e4b66bf2012-05-29 20:39:51244 // Callback type used with the ShowOneClickSigninBubble() method. If the
245 // user chooses to accept the sign in, the callback is called to start the
246 // sync process.
247 typedef base::Callback<void(OneClickSigninSyncStarter::StartSyncMode)>
248 StartSyncCallback;
249
[email protected]0cf5d282013-04-12 18:33:12250 // Shows the one-click sign in bubble. |email| holds the full email address
251 // of the account that has signed in.
[email protected]fe54b4a2012-03-28 16:11:04252 virtual void ShowOneClickSigninBubble(
[email protected]265c9272013-01-25 19:18:45253 OneClickSigninBubbleType type,
[email protected]dcd0249872013-12-06 23:58:45254 const base::string16& email,
255 const base::string16& error_message,
[email protected]e4b66bf2012-05-29 20:39:51256 const StartSyncCallback& start_sync_callback) = 0;
[email protected]e625b7602013-10-28 09:24:56257#endif
[email protected]235a0562012-03-26 22:22:35258
[email protected]69b04b92010-11-08 22:12:18259 // Whether or not the shelf view is visible.
260 virtual bool IsDownloadShelfVisible() const = 0;
261
262 // Returns the DownloadShelf.
263 virtual DownloadShelf* GetDownloadShelf() = 0;
264
[email protected]69b04b92010-11-08 22:12:18265 // Shows the confirmation dialog box warning that the browser is closing with
266 // in-progress downloads.
[email protected]edfca702013-08-16 08:58:14267 // This method should call |callback| with the user's response.
268 virtual void ConfirmBrowserCloseWithPendingDownloads(
269 int download_count,
270 Browser::DownloadClosePreventionType dialog_type,
271 bool app_modal,
272 const base::Callback<void(bool)>& callback) = 0;
[email protected]69b04b92010-11-08 22:12:18273
[email protected]a0ea76c2011-03-23 17:36:42274 // ThemeService calls this when a user has changed his or her theme,
[email protected]69b04b92010-11-08 22:12:18275 // indicating that it's time to redraw everything.
276 virtual void UserChangedTheme() = 0;
277
278 // Get extra vertical height that the render view should add to its requests
279 // to webkit. This can help prevent sending extraneous layout/repaint requests
280 // when the delegate is in the process of resizing the tab contents view (e.g.
281 // during infobar animations).
282 virtual int GetExtraRenderViewHeight() const = 0;
283
[email protected]2a6bc3e2011-12-28 23:51:33284 // Notification that |contents| got the focus through user action (click
[email protected]69b04b92010-11-08 22:12:18285 // on the page).
[email protected]2a6bc3e2011-12-28 23:51:33286 virtual void WebContentsFocused(content::WebContents* contents) = 0;
[email protected]69b04b92010-11-08 22:12:18287
[email protected]b8e681e82012-02-20 10:18:47288 // Shows the website settings using the specified information. |url| is the
289 // url of the page/frame the info applies to, |ssl| is the SSL information for
290 // that page/frame. If |show_history| is true, a section showing how many
291 // times that URL has been visited is added to the page info.
292 virtual void ShowWebsiteSettings(Profile* profile,
[email protected]36ad4aa82012-11-21 19:20:48293 content::WebContents* web_contents,
[email protected]b8e681e82012-02-20 10:18:47294 const GURL& url,
[email protected]9fb47a82013-07-05 11:34:02295 const content::SSLStatus& ssl) = 0;
[email protected]b8e681e82012-02-20 10:18:47296
[email protected]69b04b92010-11-08 22:12:18297 // Shows the app menu (for accessibility).
298 virtual void ShowAppMenu() = 0;
299
300 // Allows the BrowserWindow object to handle the specified keyboard event
301 // before sending it to the renderer.
302 // Returns true if the |event| was handled. Otherwise, if the |event| would
303 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut,
304 // |*is_keyboard_shortcut| should be set to true.
[email protected]b87ee522012-05-18 15:16:54305 virtual bool PreHandleKeyboardEvent(
306 const content::NativeWebKeyboardEvent& event,
307 bool* is_keyboard_shortcut) = 0;
[email protected]69b04b92010-11-08 22:12:18308
309 // Allows the BrowserWindow object to handle the specified keyboard event,
310 // if the renderer did not process it.
[email protected]b87ee522012-05-18 15:16:54311 virtual void HandleKeyboardEvent(
312 const content::NativeWebKeyboardEvent& event) = 0;
[email protected]69b04b92010-11-08 22:12:18313
[email protected]69b04b92010-11-08 22:12:18314 // Clipboard commands applied to the whole browser window.
315 virtual void Cut() = 0;
316 virtual void Copy() = 0;
317 virtual void Paste() = 0;
318
[email protected]69b04b92010-11-08 22:12:18319#if defined(OS_MACOSX)
[email protected]34337d32013-01-29 20:29:01320 // Enters Mac specific fullscreen mode with chrome displayed (e.g. omnibox)
321 // on OSX 10.7+, a.k.a. Lion Fullscreen mode.
322 // Invalid to call on OSX earlier than 10.7.
323 // Enters either from non fullscreen, or from fullscreen without chrome.
324 // Exit to normal fullscreen with EnterFullscreen().
325 virtual void EnterFullscreenWithChrome() = 0;
326 virtual bool IsFullscreenWithChrome() = 0;
327 virtual bool IsFullscreenWithoutChrome() = 0;
[email protected]69b04b92010-11-08 22:12:18328#endif
329
[email protected]588300d2011-04-28 21:06:35330 // Return the correct disposition for a popup window based on |bounds|.
331 virtual WindowOpenDisposition GetDispositionForPopupBounds(
332 const gfx::Rect& bounds) = 0;
333
[email protected]632983f2011-08-08 22:51:24334 // Construct a FindBar implementation for the |browser|.
335 virtual FindBar* CreateFindBar() = 0;
336
[email protected]7519c522013-04-02 01:07:23337 // Return the WebContentsModalDialogHost for use in positioning web contents
[email protected]51e91492013-09-08 23:34:41338 // modal dialogs within the browser window. This can sometimes be NULL (for
339 // instance during tab drag on Views/Win32).
[email protected]e41d0082013-05-16 04:37:54340 virtual web_modal::WebContentsModalDialogHost*
341 GetWebContentsModalDialogHost() = 0;
[email protected]6a151762012-10-03 22:33:19342
[email protected]0548c5352011-09-07 00:33:33343 // Invoked when the preferred size of the contents in current tab has been
344 // changed. We might choose to update the window size to accomodate this
345 // change.
346 // Note that this won't be fired if we change tabs.
[email protected]2a6bc3e2011-12-28 23:51:33347 virtual void UpdatePreferredSize(content::WebContents* web_contents,
[email protected]0548c5352011-09-07 00:33:33348 const gfx::Size& pref_size) {}
349
[email protected]61e2b3cc2012-03-02 16:13:34350 // Invoked when the contents auto-resized and the container should match it.
351 virtual void ResizeDueToAutoResize(content::WebContents* web_contents,
352 const gfx::Size& new_size) {}
353
[email protected]69b04b92010-11-08 22:12:18354 // Construct a BrowserWindow implementation for the specified |browser|.
355 static BrowserWindow* CreateBrowserWindow(Browser* browser);
356
[email protected]d58737692013-11-19 04:00:41357 // Returns a HostDesktopType that is compatible with the current Chrome window
358 // configuration. On Windows with Ash, this is always HOST_DESKTOP_TYPE_ASH
359 // while Chrome is running in Metro mode. Otherwise returns |desktop_type|.
360 static chrome::HostDesktopType AdjustHostDesktopType(
361 chrome::HostDesktopType desktop_type);
362
[email protected]0ec4898e2011-12-30 21:09:24363 // Shows the avatar bubble inside |web_contents|. The bubble is positioned
364 // relative to |rect|. |rect| should be in the |web_contents| coordinate
[email protected]2f733a02011-10-06 15:17:34365 // system.
[email protected]0ec4898e2011-12-30 21:09:24366 virtual void ShowAvatarBubble(content::WebContents* web_contents,
[email protected]2f733a02011-10-06 15:17:34367 const gfx::Rect& rect) = 0;
368
[email protected]7d2d08152011-10-25 22:58:47369 // Shows the avatar bubble on the window frame off of the avatar button.
370 virtual void ShowAvatarBubbleFromAvatarButton() = 0;
371
[email protected]e0f90fc2012-06-06 19:30:10372 // Show bubble for password generation positioned relative to |rect|. The
373 // subclasses implementing this interface do not own the |password_generator|
374 // object which is passed to generate the password. |form| is the form that
[email protected]f5d230b32012-12-11 02:04:11375 // contains the password field that the bubble will be associated with.
[email protected]4d5ef8692012-05-31 02:28:57376 virtual void ShowPasswordGenerationBubble(
377 const gfx::Rect& rect,
[email protected]e620d362013-09-09 08:01:53378 const autofill::PasswordForm& form,
[email protected]f5d230b32012-12-11 02:04:11379 autofill::PasswordGenerator* password_generator) = 0;
[email protected]90ee09232012-03-21 02:01:01380
[email protected]888878e82013-07-24 22:49:40381 // Invoked when the amount of vertical overscroll changes. |delta_y| is the
382 // amount of overscroll that has occured in the y-direction.
383 virtual void OverscrollUpdate(int delta_y) {}
384
[email protected]dc0fd432013-08-27 15:29:21385 // Returns the height inset for RenderView when detached bookmark bar is
386 // shown. Invoked when a new RenderHostView is created for a non-NTP
387 // navigation entry and the bookmark bar is detached.
388 virtual int GetRenderViewHeightInsetWithDetachedBookmarkBar() = 0;
389
[email protected]ddc92392014-02-25 13:41:39390 // Shows the page action for the extension.
391 virtual void ShowPageActionPopup(const extensions::Extension* extension) = 0;
392
393 // Shows the browser action for the extension. NOTE(wittman): This function
394 // grants tab permissions to the browser action popup, so it should only be
395 // invoked due to user action, not due to invocation from an extensions API.
396 virtual void ShowBrowserActionPopup(
397 const extensions::Extension* extension) = 0;
398
[email protected]69b04b92010-11-08 22:12:18399 protected:
[email protected]2e9d79f2013-08-16 05:45:56400 friend class BrowserCloseManager;
[email protected]69b04b92010-11-08 22:12:18401 friend class BrowserView;
402 virtual void DestroyBrowser() = 0;
[email protected]69b04b92010-11-08 22:12:18403};
404
405#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
406class BookmarkBarView;
407class LocationBarView;
408
409namespace views {
410class View;
411}
412#endif // defined(OS_WIN)
413
414// A BrowserWindow utility interface used for accessing elements of the browser
415// UI used only by UI test automation.
416class BrowserWindowTesting {
417 public:
418#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
419 // Returns the BookmarkBarView.
420 virtual BookmarkBarView* GetBookmarkBarView() const = 0;
421
422 // Returns the LocationBarView.
423 virtual LocationBarView* GetLocationBarView() const = 0;
424
425 // Returns the TabContentsContainer.
426 virtual views::View* GetTabContentsContainerView() const = 0;
427
[email protected]69b04b92010-11-08 22:12:18428 // Returns the ToolbarView.
429 virtual ToolbarView* GetToolbarView() const = 0;
430#endif
431
432 protected:
433 virtual ~BrowserWindowTesting() {}
434};
435
436#endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_