blob: 257730466c94731256664afbcd506153dcd8200e [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 {
[email protected]db27463f2014-02-28 21:07:5748class Command;
[email protected]1c321ee2012-05-21 03:02:3449class Extension;
50}
51
[email protected]69b04b92010-11-08 22:12:1852namespace gfx {
53class Rect;
[email protected]0548c5352011-09-07 00:33:3354class Size;
[email protected]69b04b92010-11-08 22:12:1855}
56
[email protected]e41d0082013-05-16 04:37:5457namespace web_modal {
58class WebContentsModalDialogHost;
59}
60
[email protected]69b04b92010-11-08 22:12:1861////////////////////////////////////////////////////////////////////////////////
62// BrowserWindow interface
63// An interface implemented by the "view" of the Browser window.
[email protected]5f39adc2013-05-23 11:50:4664// This interface includes ui::BaseWindow methods as well as Browser window
[email protected]41d9faf2012-02-28 23:46:0265// specific methods.
[email protected]69b04b92010-11-08 22:12:1866//
67// NOTE: All getters may return NULL.
[email protected]41d9faf2012-02-28 23:46:0268//
[email protected]5f39adc2013-05-23 11:50:4669class BrowserWindow : public ui::BaseWindow {
[email protected]69b04b92010-11-08 22:12:1870 public:
[email protected]ed2f27132011-04-04 17:19:5771 virtual ~BrowserWindow() {}
72
[email protected]41d9faf2012-02-28 23:46:0273 //////////////////////////////////////////////////////////////////////////////
[email protected]5f39adc2013-05-23 11:50:4674 // ui::BaseWindow interface notes:
[email protected]69b04b92010-11-08 22:12:1875
[email protected]41d9faf2012-02-28 23:46:0276 // Closes the window as soon as possible. If the window is not in a drag
[email protected]69b04b92010-11-08 22:12:1877 // session, it will close immediately; otherwise, it will move offscreen (so
78 // events are still fired) until the drag ends, then close. This assumes
79 // that the Browser is not immediately destroyed, but will be eventually
80 // destroyed by other means (eg, the tab strip going to zero elements).
81 // Bad things happen if the Browser dtor is called directly as a result of
82 // invoking this method.
[email protected]41d9faf2012-02-28 23:46:0283 // virtual void Close() = 0;
[email protected]69b04b92010-11-08 22:12:1884
[email protected]41d9faf2012-02-28 23:46:0285 // Browser::OnWindowDidShow should be called after showing the window.
86 // virtual void Show() = 0;
[email protected]69b04b92010-11-08 22:12:1887
[email protected]41d9faf2012-02-28 23:46:0288 //////////////////////////////////////////////////////////////////////////////
89 // Browser specific methods:
[email protected]69b04b92010-11-08 22:12:1890
[email protected]69b04b92010-11-08 22:12:1891 // Returns a pointer to the testing interface to the Browser window, or NULL
92 // if there is none.
93 virtual BrowserWindowTesting* GetBrowserWindowTesting() = 0;
94
95 // Return the status bubble associated with the frame
96 virtual StatusBubble* GetStatusBubble() = 0;
97
[email protected]69b04b92010-11-08 22:12:1898 // Inform the frame that the selected tab favicon or title has changed. Some
99 // frames may need to refresh their title bar.
100 virtual void UpdateTitleBar() = 0;
101
[email protected]09b29342011-06-24 19:18:48102 // Invoked when the state of the bookmark bar changes. This is only invoked if
103 // the state changes for the current tab, it is not sent when switching tabs.
104 virtual void BookmarkBarStateChanged(
105 BookmarkBar::AnimateChangeType change_type) = 0;
[email protected]69b04b92010-11-08 22:12:18106
107 // Inform the frame that the dev tools window for the selected tab has
108 // changed.
109 virtual void UpdateDevTools() = 0;
110
111 // Update any loading animations running in the window. |should_animate| is
112 // true if there are tabs loading and the animations should continue, false
113 // if there are no active loads and the animations should end.
114 virtual void UpdateLoadingAnimations(bool should_animate) = 0;
115
116 // Sets the starred state for the current tab.
117 virtual void SetStarredState(bool is_starred) = 0;
118
[email protected]3917f82a2013-11-21 06:25:54119 // Sets whether the translate icon is lit for the current tab.
120 virtual void SetTranslateIconToggled(bool is_lit) = 0;
121
[email protected]08726d5e2013-09-24 21:52:55122 // Called when the active tab changes. Subclasses which implement
123 // TabStripModelObserver should implement this instead of ActiveTabChanged();
124 // the Browser will call this method while processing that one.
125 virtual void OnActiveTabChanged(content::WebContents* old_contents,
126 content::WebContents* new_contents,
127 int index,
128 int reason) = 0;
129
[email protected]5423c372012-08-22 05:50:16130 // Called to force the zoom state to for the active tab to be recalculated.
131 // |can_show_bubble| is true when a user presses the zoom up or down keyboard
132 // shortcuts and will be false in other cases (e.g. switching tabs, "clicking"
133 // + or - in the wrench menu to change zoom).
134 virtual void ZoomChangedForActiveTab(bool can_show_bubble) = 0;
[email protected]6f80e932012-06-04 19:00:07135
[email protected]69b04b92010-11-08 22:12:18136 // Accessors for fullscreen mode state.
[email protected]8d944b32011-10-17 06:11:53137 virtual void EnterFullscreen(const GURL& url,
138 FullscreenExitBubbleType bubble_type) = 0;
[email protected]55c87fa2011-10-15 07:28:28139 virtual void ExitFullscreen() = 0;
[email protected]8d944b32011-10-17 06:11:53140 virtual void UpdateFullscreenExitBubbleContent(
141 const GURL& url,
142 FullscreenExitBubbleType bubble_type) = 0;
[email protected]69b04b92010-11-08 22:12:18143
[email protected]6a414ff2013-02-27 08:22:54144 // Windows and GTK remove the top controls in fullscreen, but Mac and Ash
145 // keep the controls in a slide-down panel.
146 virtual bool ShouldHideUIForFullscreen() const = 0;
147
[email protected]69b04b92010-11-08 22:12:18148 // Returns true if the fullscreen bubble is visible.
149 virtual bool IsFullscreenBubbleVisible() const = 0;
150
[email protected]77cbe50e2012-06-14 02:44:38151#if defined(OS_WIN)
152 // Sets state for entering or exiting Win8 Metro snap mode.
153 virtual void SetMetroSnapMode(bool enable) = 0;
154
155 // Returns whether the window is currently in Win8 Metro snap mode.
156 virtual bool IsInMetroSnapMode() const = 0;
157#endif
158
[email protected]69b04b92010-11-08 22:12:18159 // Returns the location bar.
160 virtual LocationBar* GetLocationBar() const = 0;
161
162 // Tries to focus the location bar. Clears the window focus (to avoid
163 // inconsistent state) if this fails.
164 virtual void SetFocusToLocationBar(bool select_all) = 0;
165
166 // Informs the view whether or not a load is in progress for the current tab.
167 // The view can use this notification to update the reload/stop button.
168 virtual void UpdateReloadStopState(bool is_loading, bool force) = 0;
169
170 // Updates the toolbar with the state for the specified |contents|.
[email protected]2e7fe4312013-08-21 17:19:48171 virtual void UpdateToolbar(content::WebContents* contents) = 0;
[email protected]69b04b92010-11-08 22:12:18172
173 // Focuses the toolbar (for accessibility).
174 virtual void FocusToolbar() = 0;
175
176 // Focuses the app menu like it was a menu bar.
177 //
178 // Not used on the Mac, which has a "normal" menu bar.
179 virtual void FocusAppMenu() = 0;
180
181 // Focuses the bookmarks toolbar (for accessibility).
182 virtual void FocusBookmarksToolbar() = 0;
183
[email protected]822ca8c62013-04-19 00:49:15184 // Focuses an infobar, if shown (for accessibility).
185 virtual void FocusInfobars() = 0;
186
[email protected]69b04b92010-11-08 22:12:18187 // Moves keyboard focus to the next pane.
188 virtual void RotatePaneFocus(bool forwards) = 0;
189
190 // Returns whether the bookmark bar is visible or not.
191 virtual bool IsBookmarkBarVisible() const = 0;
192
193 // Returns whether the bookmark bar is animating or not.
194 virtual bool IsBookmarkBarAnimating() const = 0;
195
[email protected]95bf8a5b2010-12-22 16:04:07196 // Returns whether the tab strip is editable (for extensions).
197 virtual bool IsTabStripEditable() const = 0;
198
[email protected]69b04b92010-11-08 22:12:18199 // Returns whether the tool bar is visible or not.
200 virtual bool IsToolbarVisible() const = 0;
201
[email protected]b7a756d42012-01-23 18:08:17202 // Returns the rect where the resize corner should be drawn by the render
203 // widget host view (on top of what the renderer returns). We return an empty
204 // rect to identify that there shouldn't be a resize corner (in the cases
205 // where we take care of it ourselves at the browser level).
206 virtual gfx::Rect GetRootWindowResizerRect() const = 0;
207
[email protected]69b04b92010-11-08 22:12:18208 // Shows a confirmation dialog box for adding a search engine described by
209 // |template_url|. Takes ownership of |template_url|.
[email protected]3613347d2012-04-27 20:27:37210 virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
[email protected]69b04b92010-11-08 22:12:18211 Profile* profile) = 0;
212
[email protected]69b04b92010-11-08 22:12:18213 // Shows the Update Recommended dialog box.
214 virtual void ShowUpdateChromeDialog() = 0;
215
[email protected]69b04b92010-11-08 22:12:18216 // Shows the Bookmark bubble. |url| is the URL being bookmarked,
217 // |already_bookmarked| is true if the url is already bookmarked.
218 virtual void ShowBookmarkBubble(const GURL& url, bool already_bookmarked) = 0;
219
[email protected]46601462014-02-04 11:08:50220 // Shows the Bookmark App bubble.
221 // See Extension::InitFromValueFlags::FROM_BOOKMARK for a description of
222 // bookmark apps.
223 //
224 // |web_app_info| is the WebApplicationInfo being converted into an app.
225 // |extension_id| is the id of the bookmark app.
226 virtual void ShowBookmarkAppBubble(const WebApplicationInfo& web_app_info,
227 const std::string& extension_id) = 0;
228
[email protected]195c99c2012-10-31 06:24:51229 // Shows the bookmark prompt.
230 // TODO(yosin): Make ShowBookmarkPrompt pure virtual.
231 virtual void ShowBookmarkPrompt() {}
232
[email protected]e625b7602013-10-28 09:24:56233 // Shows the translate bubble.
[email protected]bccf5ab2014-02-15 08:20:30234 virtual void ShowTranslateBubble(content::WebContents* contents,
235 TranslateTabHelper::TranslateStep step,
236 TranslateErrors::Type error_type) = 0;
[email protected]e625b7602013-10-28 09:24:56237
[email protected]235a0562012-03-26 22:22:35238#if defined(ENABLE_ONE_CLICK_SIGNIN)
[email protected]265c9272013-01-25 19:18:45239 enum OneClickSigninBubbleType {
240 ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE,
[email protected]0cf5d282013-04-12 18:33:12241 ONE_CLICK_SIGNIN_BUBBLE_TYPE_MODAL_DIALOG,
242 ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG
[email protected]265c9272013-01-25 19:18:45243 };
244
[email protected]e4b66bf2012-05-29 20:39:51245 // Callback type used with the ShowOneClickSigninBubble() method. If the
246 // user chooses to accept the sign in, the callback is called to start the
247 // sync process.
248 typedef base::Callback<void(OneClickSigninSyncStarter::StartSyncMode)>
249 StartSyncCallback;
250
[email protected]0cf5d282013-04-12 18:33:12251 // Shows the one-click sign in bubble. |email| holds the full email address
252 // of the account that has signed in.
[email protected]fe54b4a2012-03-28 16:11:04253 virtual void ShowOneClickSigninBubble(
[email protected]265c9272013-01-25 19:18:45254 OneClickSigninBubbleType type,
[email protected]dcd0249872013-12-06 23:58:45255 const base::string16& email,
256 const base::string16& error_message,
[email protected]e4b66bf2012-05-29 20:39:51257 const StartSyncCallback& start_sync_callback) = 0;
[email protected]e625b7602013-10-28 09:24:56258#endif
[email protected]235a0562012-03-26 22:22:35259
[email protected]69b04b92010-11-08 22:12:18260 // Whether or not the shelf view is visible.
261 virtual bool IsDownloadShelfVisible() const = 0;
262
263 // Returns the DownloadShelf.
264 virtual DownloadShelf* GetDownloadShelf() = 0;
265
[email protected]69b04b92010-11-08 22:12:18266 // Shows the confirmation dialog box warning that the browser is closing with
267 // in-progress downloads.
[email protected]edfca702013-08-16 08:58:14268 // This method should call |callback| with the user's response.
269 virtual void ConfirmBrowserCloseWithPendingDownloads(
270 int download_count,
271 Browser::DownloadClosePreventionType dialog_type,
272 bool app_modal,
273 const base::Callback<void(bool)>& callback) = 0;
[email protected]69b04b92010-11-08 22:12:18274
[email protected]a0ea76c2011-03-23 17:36:42275 // ThemeService calls this when a user has changed his or her theme,
[email protected]69b04b92010-11-08 22:12:18276 // indicating that it's time to redraw everything.
277 virtual void UserChangedTheme() = 0;
278
279 // Get extra vertical height that the render view should add to its requests
280 // to webkit. This can help prevent sending extraneous layout/repaint requests
281 // when the delegate is in the process of resizing the tab contents view (e.g.
282 // during infobar animations).
283 virtual int GetExtraRenderViewHeight() const = 0;
284
[email protected]2a6bc3e2011-12-28 23:51:33285 // Notification that |contents| got the focus through user action (click
[email protected]69b04b92010-11-08 22:12:18286 // on the page).
[email protected]2a6bc3e2011-12-28 23:51:33287 virtual void WebContentsFocused(content::WebContents* contents) = 0;
[email protected]69b04b92010-11-08 22:12:18288
[email protected]b8e681e82012-02-20 10:18:47289 // Shows the website settings using the specified information. |url| is the
290 // url of the page/frame the info applies to, |ssl| is the SSL information for
291 // that page/frame. If |show_history| is true, a section showing how many
292 // times that URL has been visited is added to the page info.
293 virtual void ShowWebsiteSettings(Profile* profile,
[email protected]36ad4aa82012-11-21 19:20:48294 content::WebContents* web_contents,
[email protected]b8e681e82012-02-20 10:18:47295 const GURL& url,
[email protected]9fb47a82013-07-05 11:34:02296 const content::SSLStatus& ssl) = 0;
[email protected]b8e681e82012-02-20 10:18:47297
[email protected]69b04b92010-11-08 22:12:18298 // Shows the app menu (for accessibility).
299 virtual void ShowAppMenu() = 0;
300
301 // Allows the BrowserWindow object to handle the specified keyboard event
302 // before sending it to the renderer.
303 // Returns true if the |event| was handled. Otherwise, if the |event| would
304 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut,
305 // |*is_keyboard_shortcut| should be set to true.
[email protected]b87ee522012-05-18 15:16:54306 virtual bool PreHandleKeyboardEvent(
307 const content::NativeWebKeyboardEvent& event,
308 bool* is_keyboard_shortcut) = 0;
[email protected]69b04b92010-11-08 22:12:18309
310 // Allows the BrowserWindow object to handle the specified keyboard event,
311 // if the renderer did not process it.
[email protected]b87ee522012-05-18 15:16:54312 virtual void HandleKeyboardEvent(
313 const content::NativeWebKeyboardEvent& event) = 0;
[email protected]69b04b92010-11-08 22:12:18314
[email protected]69b04b92010-11-08 22:12:18315 // Clipboard commands applied to the whole browser window.
316 virtual void Cut() = 0;
317 virtual void Copy() = 0;
318 virtual void Paste() = 0;
319
[email protected]69b04b92010-11-08 22:12:18320#if defined(OS_MACOSX)
[email protected]34337d32013-01-29 20:29:01321 // Enters Mac specific fullscreen mode with chrome displayed (e.g. omnibox)
322 // on OSX 10.7+, a.k.a. Lion Fullscreen mode.
323 // Invalid to call on OSX earlier than 10.7.
324 // Enters either from non fullscreen, or from fullscreen without chrome.
325 // Exit to normal fullscreen with EnterFullscreen().
326 virtual void EnterFullscreenWithChrome() = 0;
327 virtual bool IsFullscreenWithChrome() = 0;
328 virtual bool IsFullscreenWithoutChrome() = 0;
[email protected]69b04b92010-11-08 22:12:18329#endif
330
[email protected]588300d2011-04-28 21:06:35331 // Return the correct disposition for a popup window based on |bounds|.
332 virtual WindowOpenDisposition GetDispositionForPopupBounds(
333 const gfx::Rect& bounds) = 0;
334
[email protected]632983f2011-08-08 22:51:24335 // Construct a FindBar implementation for the |browser|.
336 virtual FindBar* CreateFindBar() = 0;
337
[email protected]7519c522013-04-02 01:07:23338 // Return the WebContentsModalDialogHost for use in positioning web contents
[email protected]51e91492013-09-08 23:34:41339 // modal dialogs within the browser window. This can sometimes be NULL (for
340 // instance during tab drag on Views/Win32).
[email protected]e41d0082013-05-16 04:37:54341 virtual web_modal::WebContentsModalDialogHost*
342 GetWebContentsModalDialogHost() = 0;
[email protected]6a151762012-10-03 22:33:19343
[email protected]0548c5352011-09-07 00:33:33344 // Invoked when the preferred size of the contents in current tab has been
345 // changed. We might choose to update the window size to accomodate this
346 // change.
347 // Note that this won't be fired if we change tabs.
[email protected]2a6bc3e2011-12-28 23:51:33348 virtual void UpdatePreferredSize(content::WebContents* web_contents,
[email protected]0548c5352011-09-07 00:33:33349 const gfx::Size& pref_size) {}
350
[email protected]61e2b3cc2012-03-02 16:13:34351 // Invoked when the contents auto-resized and the container should match it.
352 virtual void ResizeDueToAutoResize(content::WebContents* web_contents,
353 const gfx::Size& new_size) {}
354
[email protected]69b04b92010-11-08 22:12:18355 // Construct a BrowserWindow implementation for the specified |browser|.
356 static BrowserWindow* CreateBrowserWindow(Browser* browser);
357
[email protected]d58737692013-11-19 04:00:41358 // Returns a HostDesktopType that is compatible with the current Chrome window
359 // configuration. On Windows with Ash, this is always HOST_DESKTOP_TYPE_ASH
360 // while Chrome is running in Metro mode. Otherwise returns |desktop_type|.
361 static chrome::HostDesktopType AdjustHostDesktopType(
362 chrome::HostDesktopType desktop_type);
363
[email protected]0ec4898e2011-12-30 21:09:24364 // Shows the avatar bubble inside |web_contents|. The bubble is positioned
365 // relative to |rect|. |rect| should be in the |web_contents| coordinate
[email protected]2f733a02011-10-06 15:17:34366 // system.
[email protected]0ec4898e2011-12-30 21:09:24367 virtual void ShowAvatarBubble(content::WebContents* web_contents,
[email protected]2f733a02011-10-06 15:17:34368 const gfx::Rect& rect) = 0;
369
[email protected]7d2d08152011-10-25 22:58:47370 // Shows the avatar bubble on the window frame off of the avatar button.
371 virtual void ShowAvatarBubbleFromAvatarButton() = 0;
372
[email protected]e0f90fc2012-06-06 19:30:10373 // Show bubble for password generation positioned relative to |rect|. The
374 // subclasses implementing this interface do not own the |password_generator|
375 // object which is passed to generate the password. |form| is the form that
[email protected]f5d230b32012-12-11 02:04:11376 // contains the password field that the bubble will be associated with.
[email protected]4d5ef8692012-05-31 02:28:57377 virtual void ShowPasswordGenerationBubble(
378 const gfx::Rect& rect,
[email protected]e620d362013-09-09 08:01:53379 const autofill::PasswordForm& form,
[email protected]f5d230b32012-12-11 02:04:11380 autofill::PasswordGenerator* password_generator) = 0;
[email protected]90ee09232012-03-21 02:01:01381
[email protected]888878e82013-07-24 22:49:40382 // Invoked when the amount of vertical overscroll changes. |delta_y| is the
383 // amount of overscroll that has occured in the y-direction.
384 virtual void OverscrollUpdate(int delta_y) {}
385
[email protected]dc0fd432013-08-27 15:29:21386 // Returns the height inset for RenderView when detached bookmark bar is
387 // shown. Invoked when a new RenderHostView is created for a non-NTP
388 // navigation entry and the bookmark bar is detached.
389 virtual int GetRenderViewHeightInsetWithDetachedBookmarkBar() = 0;
390
[email protected]db27463f2014-02-28 21:07:57391 // Executes |command| registered by |extension|.
392 virtual void ExecuteExtensionCommand(const extensions::Extension* extension,
393 const extensions::Command& command) = 0;
394
[email protected]ddc92392014-02-25 13:41:39395 // Shows the page action for the extension.
396 virtual void ShowPageActionPopup(const extensions::Extension* extension) = 0;
397
398 // Shows the browser action for the extension. NOTE(wittman): This function
399 // grants tab permissions to the browser action popup, so it should only be
400 // invoked due to user action, not due to invocation from an extensions API.
401 virtual void ShowBrowserActionPopup(
402 const extensions::Extension* extension) = 0;
403
[email protected]69b04b92010-11-08 22:12:18404 protected:
[email protected]2e9d79f2013-08-16 05:45:56405 friend class BrowserCloseManager;
[email protected]69b04b92010-11-08 22:12:18406 friend class BrowserView;
407 virtual void DestroyBrowser() = 0;
[email protected]69b04b92010-11-08 22:12:18408};
409
410#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
411class BookmarkBarView;
412class LocationBarView;
413
414namespace views {
415class View;
416}
417#endif // defined(OS_WIN)
418
419// A BrowserWindow utility interface used for accessing elements of the browser
420// UI used only by UI test automation.
421class BrowserWindowTesting {
422 public:
423#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
424 // Returns the BookmarkBarView.
425 virtual BookmarkBarView* GetBookmarkBarView() const = 0;
426
427 // Returns the LocationBarView.
428 virtual LocationBarView* GetLocationBarView() const = 0;
429
430 // Returns the TabContentsContainer.
431 virtual views::View* GetTabContentsContainerView() const = 0;
432
[email protected]69b04b92010-11-08 22:12:18433 // Returns the ToolbarView.
434 virtual ToolbarView* GetToolbarView() const = 0;
435#endif
436
437 protected:
438 virtual ~BrowserWindowTesting() {}
439};
440
441#endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_