blob: 431c35a04720c4ae497a2a43bee61174eab030b3 [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]e625b7602013-10-28 09:24:56229 // Shows the translate bubble.
[email protected]bccf5ab2014-02-15 08:20:30230 virtual void ShowTranslateBubble(content::WebContents* contents,
[email protected]b5d22782014-04-07 11:02:09231 translate::TranslateStep step,
[email protected]bccf5ab2014-02-15 08:20:30232 TranslateErrors::Type error_type) = 0;
[email protected]e625b7602013-10-28 09:24:56233
[email protected]235a0562012-03-26 22:22:35234#if defined(ENABLE_ONE_CLICK_SIGNIN)
[email protected]265c9272013-01-25 19:18:45235 enum OneClickSigninBubbleType {
236 ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE,
[email protected]0cf5d282013-04-12 18:33:12237 ONE_CLICK_SIGNIN_BUBBLE_TYPE_MODAL_DIALOG,
238 ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG
[email protected]265c9272013-01-25 19:18:45239 };
240
[email protected]e4b66bf2012-05-29 20:39:51241 // Callback type used with the ShowOneClickSigninBubble() method. If the
242 // user chooses to accept the sign in, the callback is called to start the
243 // sync process.
244 typedef base::Callback<void(OneClickSigninSyncStarter::StartSyncMode)>
245 StartSyncCallback;
246
[email protected]0cf5d282013-04-12 18:33:12247 // Shows the one-click sign in bubble. |email| holds the full email address
248 // of the account that has signed in.
[email protected]fe54b4a2012-03-28 16:11:04249 virtual void ShowOneClickSigninBubble(
[email protected]265c9272013-01-25 19:18:45250 OneClickSigninBubbleType type,
[email protected]dcd0249872013-12-06 23:58:45251 const base::string16& email,
252 const base::string16& error_message,
[email protected]e4b66bf2012-05-29 20:39:51253 const StartSyncCallback& start_sync_callback) = 0;
[email protected]e625b7602013-10-28 09:24:56254#endif
[email protected]235a0562012-03-26 22:22:35255
[email protected]69b04b92010-11-08 22:12:18256 // Whether or not the shelf view is visible.
257 virtual bool IsDownloadShelfVisible() const = 0;
258
259 // Returns the DownloadShelf.
260 virtual DownloadShelf* GetDownloadShelf() = 0;
261
[email protected]69b04b92010-11-08 22:12:18262 // Shows the confirmation dialog box warning that the browser is closing with
263 // in-progress downloads.
[email protected]edfca702013-08-16 08:58:14264 // This method should call |callback| with the user's response.
265 virtual void ConfirmBrowserCloseWithPendingDownloads(
266 int download_count,
267 Browser::DownloadClosePreventionType dialog_type,
268 bool app_modal,
269 const base::Callback<void(bool)>& callback) = 0;
[email protected]69b04b92010-11-08 22:12:18270
[email protected]a0ea76c2011-03-23 17:36:42271 // ThemeService calls this when a user has changed his or her theme,
[email protected]69b04b92010-11-08 22:12:18272 // indicating that it's time to redraw everything.
273 virtual void UserChangedTheme() = 0;
274
275 // Get extra vertical height that the render view should add to its requests
276 // to webkit. This can help prevent sending extraneous layout/repaint requests
277 // when the delegate is in the process of resizing the tab contents view (e.g.
278 // during infobar animations).
279 virtual int GetExtraRenderViewHeight() const = 0;
280
[email protected]2a6bc3e2011-12-28 23:51:33281 // Notification that |contents| got the focus through user action (click
[email protected]69b04b92010-11-08 22:12:18282 // on the page).
[email protected]2a6bc3e2011-12-28 23:51:33283 virtual void WebContentsFocused(content::WebContents* contents) = 0;
[email protected]69b04b92010-11-08 22:12:18284
[email protected]b8e681e82012-02-20 10:18:47285 // Shows the website settings using the specified information. |url| is the
286 // url of the page/frame the info applies to, |ssl| is the SSL information for
287 // that page/frame. If |show_history| is true, a section showing how many
288 // times that URL has been visited is added to the page info.
289 virtual void ShowWebsiteSettings(Profile* profile,
[email protected]36ad4aa82012-11-21 19:20:48290 content::WebContents* web_contents,
[email protected]b8e681e82012-02-20 10:18:47291 const GURL& url,
[email protected]9fb47a82013-07-05 11:34:02292 const content::SSLStatus& ssl) = 0;
[email protected]b8e681e82012-02-20 10:18:47293
[email protected]69b04b92010-11-08 22:12:18294 // Shows the app menu (for accessibility).
295 virtual void ShowAppMenu() = 0;
296
297 // Allows the BrowserWindow object to handle the specified keyboard event
298 // before sending it to the renderer.
299 // Returns true if the |event| was handled. Otherwise, if the |event| would
300 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut,
301 // |*is_keyboard_shortcut| should be set to true.
[email protected]b87ee522012-05-18 15:16:54302 virtual bool PreHandleKeyboardEvent(
303 const content::NativeWebKeyboardEvent& event,
304 bool* is_keyboard_shortcut) = 0;
[email protected]69b04b92010-11-08 22:12:18305
306 // Allows the BrowserWindow object to handle the specified keyboard event,
307 // if the renderer did not process it.
[email protected]b87ee522012-05-18 15:16:54308 virtual void HandleKeyboardEvent(
309 const content::NativeWebKeyboardEvent& event) = 0;
[email protected]69b04b92010-11-08 22:12:18310
[email protected]69b04b92010-11-08 22:12:18311 // Clipboard commands applied to the whole browser window.
312 virtual void Cut() = 0;
313 virtual void Copy() = 0;
314 virtual void Paste() = 0;
315
[email protected]69b04b92010-11-08 22:12:18316#if defined(OS_MACOSX)
[email protected]34337d32013-01-29 20:29:01317 // Enters Mac specific fullscreen mode with chrome displayed (e.g. omnibox)
318 // on OSX 10.7+, a.k.a. Lion Fullscreen mode.
319 // Invalid to call on OSX earlier than 10.7.
320 // Enters either from non fullscreen, or from fullscreen without chrome.
321 // Exit to normal fullscreen with EnterFullscreen().
322 virtual void EnterFullscreenWithChrome() = 0;
323 virtual bool IsFullscreenWithChrome() = 0;
324 virtual bool IsFullscreenWithoutChrome() = 0;
[email protected]69b04b92010-11-08 22:12:18325#endif
326
[email protected]588300d2011-04-28 21:06:35327 // Return the correct disposition for a popup window based on |bounds|.
328 virtual WindowOpenDisposition GetDispositionForPopupBounds(
329 const gfx::Rect& bounds) = 0;
330
[email protected]632983f2011-08-08 22:51:24331 // Construct a FindBar implementation for the |browser|.
332 virtual FindBar* CreateFindBar() = 0;
333
[email protected]7519c522013-04-02 01:07:23334 // Return the WebContentsModalDialogHost for use in positioning web contents
[email protected]51e91492013-09-08 23:34:41335 // modal dialogs within the browser window. This can sometimes be NULL (for
336 // instance during tab drag on Views/Win32).
[email protected]e41d0082013-05-16 04:37:54337 virtual web_modal::WebContentsModalDialogHost*
338 GetWebContentsModalDialogHost() = 0;
[email protected]6a151762012-10-03 22:33:19339
[email protected]0548c5352011-09-07 00:33:33340 // Invoked when the preferred size of the contents in current tab has been
341 // changed. We might choose to update the window size to accomodate this
342 // change.
343 // Note that this won't be fired if we change tabs.
[email protected]2a6bc3e2011-12-28 23:51:33344 virtual void UpdatePreferredSize(content::WebContents* web_contents,
[email protected]0548c5352011-09-07 00:33:33345 const gfx::Size& pref_size) {}
346
[email protected]61e2b3cc2012-03-02 16:13:34347 // Invoked when the contents auto-resized and the container should match it.
348 virtual void ResizeDueToAutoResize(content::WebContents* web_contents,
349 const gfx::Size& new_size) {}
350
[email protected]69b04b92010-11-08 22:12:18351 // Construct a BrowserWindow implementation for the specified |browser|.
352 static BrowserWindow* CreateBrowserWindow(Browser* browser);
353
[email protected]d58737692013-11-19 04:00:41354 // Returns a HostDesktopType that is compatible with the current Chrome window
355 // configuration. On Windows with Ash, this is always HOST_DESKTOP_TYPE_ASH
356 // while Chrome is running in Metro mode. Otherwise returns |desktop_type|.
357 static chrome::HostDesktopType AdjustHostDesktopType(
358 chrome::HostDesktopType desktop_type);
359
[email protected]0ec4898e2011-12-30 21:09:24360 // Shows the avatar bubble inside |web_contents|. The bubble is positioned
361 // relative to |rect|. |rect| should be in the |web_contents| coordinate
[email protected]2f733a02011-10-06 15:17:34362 // system.
[email protected]0ec4898e2011-12-30 21:09:24363 virtual void ShowAvatarBubble(content::WebContents* web_contents,
[email protected]2f733a02011-10-06 15:17:34364 const gfx::Rect& rect) = 0;
365
[email protected]d7506bf2014-03-21 16:15:51366 // Shows the avatar bubble on the window frame off of the avatar button with
367 // the given mode.
368 enum AvatarBubbleMode {
369 AVATAR_BUBBLE_MODE_DEFAULT,
370 AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT
371 };
372 virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) = 0;
[email protected]7d2d08152011-10-25 22:58:47373
[email protected]e0f90fc2012-06-06 19:30:10374 // Show bubble for password generation positioned relative to |rect|. The
375 // subclasses implementing this interface do not own the |password_generator|
376 // object which is passed to generate the password. |form| is the form that
[email protected]f5d230b32012-12-11 02:04:11377 // contains the password field that the bubble will be associated with.
[email protected]4d5ef8692012-05-31 02:28:57378 virtual void ShowPasswordGenerationBubble(
379 const gfx::Rect& rect,
[email protected]e620d362013-09-09 08:01:53380 const autofill::PasswordForm& form,
[email protected]f5d230b32012-12-11 02:04:11381 autofill::PasswordGenerator* password_generator) = 0;
[email protected]90ee09232012-03-21 02:01:01382
[email protected]888878e82013-07-24 22:49:40383 // Invoked when the amount of vertical overscroll changes. |delta_y| is the
384 // amount of overscroll that has occured in the y-direction.
385 virtual void OverscrollUpdate(int delta_y) {}
386
[email protected]dc0fd432013-08-27 15:29:21387 // Returns the height inset for RenderView when detached bookmark bar is
388 // shown. Invoked when a new RenderHostView is created for a non-NTP
389 // navigation entry and the bookmark bar is detached.
390 virtual int GetRenderViewHeightInsetWithDetachedBookmarkBar() = 0;
391
[email protected]db27463f2014-02-28 21:07:57392 // Executes |command| registered by |extension|.
393 virtual void ExecuteExtensionCommand(const extensions::Extension* extension,
394 const extensions::Command& command) = 0;
395
[email protected]ddc92392014-02-25 13:41:39396 // Shows the page action for the extension.
397 virtual void ShowPageActionPopup(const extensions::Extension* extension) = 0;
398
399 // Shows the browser action for the extension. NOTE(wittman): This function
400 // grants tab permissions to the browser action popup, so it should only be
401 // invoked due to user action, not due to invocation from an extensions API.
402 virtual void ShowBrowserActionPopup(
403 const extensions::Extension* extension) = 0;
404
[email protected]69b04b92010-11-08 22:12:18405 protected:
[email protected]2e9d79f2013-08-16 05:45:56406 friend class BrowserCloseManager;
[email protected]69b04b92010-11-08 22:12:18407 friend class BrowserView;
408 virtual void DestroyBrowser() = 0;
[email protected]69b04b92010-11-08 22:12:18409};
410
411#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
412class BookmarkBarView;
413class LocationBarView;
414
415namespace views {
416class View;
417}
418#endif // defined(OS_WIN)
419
420// A BrowserWindow utility interface used for accessing elements of the browser
421// UI used only by UI test automation.
422class BrowserWindowTesting {
423 public:
424#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
425 // Returns the BookmarkBarView.
426 virtual BookmarkBarView* GetBookmarkBarView() const = 0;
427
428 // Returns the LocationBarView.
429 virtual LocationBarView* GetLocationBarView() const = 0;
430
431 // Returns the TabContentsContainer.
432 virtual views::View* GetTabContentsContainerView() const = 0;
433
[email protected]69b04b92010-11-08 22:12:18434 // Returns the ToolbarView.
435 virtual ToolbarView* GetToolbarView() const = 0;
436#endif
437
438 protected:
439 virtual ~BrowserWindowTesting() {}
440};
441
442#endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_