[email protected] | 3a80ea33 | 2012-01-09 19:53:29 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 2 | // 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_ |
| 7 | #pragma once |
| 8 | |
[email protected] | 09b2934 | 2011-06-24 19:18:48 | [diff] [blame] | 9 | #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
[email protected] | 8d944b3 | 2011-10-17 06:11:53 | [diff] [blame] | 10 | #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 11 | #include "chrome/common/content_settings_types.h" |
[email protected] | 08397d5 | 2011-02-05 01:53:38 | [diff] [blame] | 12 | #include "ui/gfx/native_widget_types.h" |
[email protected] | 588300d | 2011-04-28 21:06:35 | [diff] [blame] | 13 | #include "webkit/glue/window_open_disposition.h" |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 14 | |
| 15 | class Browser; |
| 16 | class BrowserWindowTesting; |
| 17 | class DownloadShelf; |
| 18 | class FindBar; |
| 19 | class GURL; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 20 | class LocationBar; |
| 21 | class Profile; |
| 22 | class StatusBubble; |
| 23 | class TabContents; |
[email protected] | 3c9e187 | 2010-11-18 16:17:49 | [diff] [blame] | 24 | class TabContentsWrapper; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 25 | class TemplateURL; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 26 | #if !defined(OS_MACOSX) |
| 27 | class ToolbarView; |
| 28 | #endif |
| 29 | struct NativeWebKeyboardEvent; |
| 30 | |
[email protected] | ea049a0 | 2011-12-25 21:37:09 | [diff] [blame] | 31 | namespace content { |
| 32 | class WebContents; |
[email protected] | d583e3f2 | 2011-12-27 21:38:17 | [diff] [blame] | 33 | struct SSLStatus; |
[email protected] | ea049a0 | 2011-12-25 21:37:09 | [diff] [blame] | 34 | } |
| 35 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 36 | namespace gfx { |
| 37 | class Rect; |
[email protected] | 0548c535 | 2011-09-07 00:33:33 | [diff] [blame] | 38 | class Size; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 39 | } |
| 40 | |
[email protected] | a3b734b | 2010-11-30 03:17:11 | [diff] [blame] | 41 | class Extension; |
| 42 | |
[email protected] | 853e16eb | 2011-12-29 16:58:19 | [diff] [blame] | 43 | enum DevToolsDockSide { |
| 44 | DEVTOOLS_DOCK_SIDE_BOTTOM = 0, |
| 45 | DEVTOOLS_DOCK_SIDE_RIGHT = 1 |
| 46 | }; |
| 47 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 48 | //////////////////////////////////////////////////////////////////////////////// |
| 49 | // BrowserWindow interface |
| 50 | // An interface implemented by the "view" of the Browser window. |
| 51 | // |
| 52 | // NOTE: All getters may return NULL. |
| 53 | class BrowserWindow { |
| 54 | public: |
[email protected] | ed2f2713 | 2011-04-04 17:19:57 | [diff] [blame] | 55 | virtual ~BrowserWindow() {} |
| 56 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 57 | // Show the window, or activates it if it's already visible. |
[email protected] | 2f516c79 | 2011-09-19 22:22:09 | [diff] [blame] | 58 | // Browser::OnWindowDidShow should be called after showing the window. |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 59 | virtual void Show() = 0; |
| 60 | |
[email protected] | d4db6c70 | 2011-03-28 21:49:14 | [diff] [blame] | 61 | // Show the window, but do not activate it. Does nothing if window |
| 62 | // is already visible. |
| 63 | virtual void ShowInactive() = 0; |
| 64 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 65 | // Sets the window's size and position to the specified values. |
| 66 | virtual void SetBounds(const gfx::Rect& bounds) = 0; |
| 67 | |
| 68 | // Closes the frame as soon as possible. If the frame is not in a drag |
| 69 | // session, it will close immediately; otherwise, it will move offscreen (so |
| 70 | // events are still fired) until the drag ends, then close. This assumes |
| 71 | // that the Browser is not immediately destroyed, but will be eventually |
| 72 | // destroyed by other means (eg, the tab strip going to zero elements). |
| 73 | // Bad things happen if the Browser dtor is called directly as a result of |
| 74 | // invoking this method. |
| 75 | virtual void Close() = 0; |
| 76 | |
| 77 | // Activates (brings to front) the window. Restores the window from minimized |
| 78 | // state if necessary. |
| 79 | virtual void Activate() = 0; |
| 80 | |
| 81 | // Deactivates the window, making the next window in the Z order the active |
| 82 | // window. |
| 83 | virtual void Deactivate() = 0; |
| 84 | |
| 85 | // Returns true if the window is currently the active/focused window. |
| 86 | virtual bool IsActive() const = 0; |
| 87 | |
| 88 | // Flashes the taskbar item associated with this frame. |
| 89 | virtual void FlashFrame() = 0; |
| 90 | |
| 91 | // Return a platform dependent identifier for this frame. On Windows, this |
| 92 | // returns an HWND. |
| 93 | virtual gfx::NativeWindow GetNativeHandle() = 0; |
| 94 | |
| 95 | // Returns a pointer to the testing interface to the Browser window, or NULL |
| 96 | // if there is none. |
| 97 | virtual BrowserWindowTesting* GetBrowserWindowTesting() = 0; |
| 98 | |
| 99 | // Return the status bubble associated with the frame |
| 100 | virtual StatusBubble* GetStatusBubble() = 0; |
| 101 | |
| 102 | // Inform the receiving frame that an animation has progressed in the |
| 103 | // selected tab. |
| 104 | // TODO(beng): Remove. Infobars/Boomarks bars should talk directly to |
| 105 | // BrowserView. |
[email protected] | c9bd2e8 | 2011-04-15 23:28:19 | [diff] [blame] | 106 | virtual void ToolbarSizeChanged(bool is_animating) = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 107 | |
| 108 | // Inform the frame that the selected tab favicon or title has changed. Some |
| 109 | // frames may need to refresh their title bar. |
| 110 | virtual void UpdateTitleBar() = 0; |
| 111 | |
[email protected] | 09b2934 | 2011-06-24 19:18:48 | [diff] [blame] | 112 | // Invoked when the state of the bookmark bar changes. This is only invoked if |
| 113 | // the state changes for the current tab, it is not sent when switching tabs. |
| 114 | virtual void BookmarkBarStateChanged( |
| 115 | BookmarkBar::AnimateChangeType change_type) = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 116 | |
| 117 | // Inform the frame that the dev tools window for the selected tab has |
| 118 | // changed. |
| 119 | virtual void UpdateDevTools() = 0; |
| 120 | |
[email protected] | 853e16eb | 2011-12-29 16:58:19 | [diff] [blame] | 121 | // Requests that the docked dev tools window changes its dock mode. |
| 122 | virtual void SetDevToolsDockSide(DevToolsDockSide side) = 0; |
| 123 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 124 | // Update any loading animations running in the window. |should_animate| is |
| 125 | // true if there are tabs loading and the animations should continue, false |
| 126 | // if there are no active loads and the animations should end. |
| 127 | virtual void UpdateLoadingAnimations(bool should_animate) = 0; |
| 128 | |
| 129 | // Sets the starred state for the current tab. |
| 130 | virtual void SetStarredState(bool is_starred) = 0; |
| 131 | |
| 132 | // Returns the nonmaximized bounds of the frame (even if the frame is |
| 133 | // currently maximized or minimized) in terms of the screen coordinates. |
| 134 | virtual gfx::Rect GetRestoredBounds() const = 0; |
| 135 | |
[email protected] | d479b8e2 | 2011-02-09 05:19:49 | [diff] [blame] | 136 | // Retrieves the window's current bounds, including its frame. |
| 137 | // This will only differ from GetRestoredBounds() for maximized |
| 138 | // and minimized windows. |
| 139 | virtual gfx::Rect GetBounds() const = 0; |
| 140 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 141 | // TODO(beng): REMOVE? |
| 142 | // Returns true if the frame is maximized (aka zoomed). |
| 143 | virtual bool IsMaximized() const = 0; |
| 144 | |
[email protected] | 400eaf8 | 2011-08-22 15:47:39 | [diff] [blame] | 145 | // Returns true if the frame is minimized. |
| 146 | virtual bool IsMinimized() const = 0; |
| 147 | |
[email protected] | 541e3ee | 2011-11-22 01:31:10 | [diff] [blame] | 148 | // Maximizes/minimizes/restores the window. |
| 149 | virtual void Maximize() = 0; |
| 150 | virtual void Minimize() = 0; |
| 151 | virtual void Restore() = 0; |
| 152 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 153 | // Accessors for fullscreen mode state. |
[email protected] | 8d944b3 | 2011-10-17 06:11:53 | [diff] [blame] | 154 | virtual void EnterFullscreen(const GURL& url, |
| 155 | FullscreenExitBubbleType bubble_type) = 0; |
[email protected] | 55c87fa | 2011-10-15 07:28:28 | [diff] [blame] | 156 | virtual void ExitFullscreen() = 0; |
[email protected] | 8d944b3 | 2011-10-17 06:11:53 | [diff] [blame] | 157 | virtual void UpdateFullscreenExitBubbleContent( |
| 158 | const GURL& url, |
| 159 | FullscreenExitBubbleType bubble_type) = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 160 | virtual bool IsFullscreen() const = 0; |
| 161 | |
| 162 | // Returns true if the fullscreen bubble is visible. |
| 163 | virtual bool IsFullscreenBubbleVisible() const = 0; |
| 164 | |
| 165 | // Returns the location bar. |
| 166 | virtual LocationBar* GetLocationBar() const = 0; |
| 167 | |
| 168 | // Tries to focus the location bar. Clears the window focus (to avoid |
| 169 | // inconsistent state) if this fails. |
| 170 | virtual void SetFocusToLocationBar(bool select_all) = 0; |
| 171 | |
| 172 | // Informs the view whether or not a load is in progress for the current tab. |
| 173 | // The view can use this notification to update the reload/stop button. |
| 174 | virtual void UpdateReloadStopState(bool is_loading, bool force) = 0; |
| 175 | |
| 176 | // Updates the toolbar with the state for the specified |contents|. |
[email protected] | 3c9e187 | 2010-11-18 16:17:49 | [diff] [blame] | 177 | virtual void UpdateToolbar(TabContentsWrapper* contents, |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 178 | bool should_restore_state) = 0; |
| 179 | |
| 180 | // Focuses the toolbar (for accessibility). |
| 181 | virtual void FocusToolbar() = 0; |
| 182 | |
| 183 | // Focuses the app menu like it was a menu bar. |
| 184 | // |
| 185 | // Not used on the Mac, which has a "normal" menu bar. |
| 186 | virtual void FocusAppMenu() = 0; |
| 187 | |
| 188 | // Focuses the bookmarks toolbar (for accessibility). |
| 189 | virtual void FocusBookmarksToolbar() = 0; |
| 190 | |
| 191 | // Focuses the Chrome OS status view (for accessibility). |
| 192 | virtual void FocusChromeOSStatus() = 0; |
| 193 | |
| 194 | // Moves keyboard focus to the next pane. |
| 195 | virtual void RotatePaneFocus(bool forwards) = 0; |
| 196 | |
| 197 | // Returns whether the bookmark bar is visible or not. |
| 198 | virtual bool IsBookmarkBarVisible() const = 0; |
| 199 | |
| 200 | // Returns whether the bookmark bar is animating or not. |
| 201 | virtual bool IsBookmarkBarAnimating() const = 0; |
| 202 | |
[email protected] | 95bf8a5b | 2010-12-22 16:04:07 | [diff] [blame] | 203 | // Returns whether the tab strip is editable (for extensions). |
| 204 | virtual bool IsTabStripEditable() const = 0; |
| 205 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 206 | // Returns whether the tool bar is visible or not. |
| 207 | virtual bool IsToolbarVisible() const = 0; |
| 208 | |
[email protected] | 5f58c2af | 2012-01-11 17:55:29 | [diff] [blame^] | 209 | // Returns whether the window is a panel. This is not always synonomous |
| 210 | // with the associated browser having type panel since some environments |
| 211 | // may draw popups in panel windows. |
| 212 | virtual bool IsPanel() const = 0; |
| 213 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 214 | // Tells the frame not to render as inactive until the next activation change. |
| 215 | // This is required on Windows when dropdown selects are shown to prevent the |
| 216 | // select from deactivating the browser frame. A stub implementation is |
| 217 | // provided here since the functionality is Windows-specific. |
| 218 | virtual void DisableInactiveFrame() {} |
| 219 | |
| 220 | // Shows a confirmation dialog box for setting the default search engine |
| 221 | // described by |template_url|. Takes ownership of |template_url|. |
[email protected] | ea049a0 | 2011-12-25 21:37:09 | [diff] [blame] | 222 | virtual void ConfirmSetDefaultSearchProvider( |
| 223 | content::WebContents* web_contents, |
| 224 | TemplateURL* template_url, |
| 225 | Profile* profile) { |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 226 | // TODO(levin): Implement this for non-Windows platforms and make it pure. |
[email protected] | 9219d26 | 2011-02-15 21:05:12 | [diff] [blame] | 227 | // http://crbug.com/38475 |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | // Shows a confirmation dialog box for adding a search engine described by |
| 231 | // |template_url|. Takes ownership of |template_url|. |
| 232 | virtual void ConfirmAddSearchProvider(const TemplateURL* template_url, |
| 233 | Profile* profile) = 0; |
| 234 | |
| 235 | // Shows or hides the bookmark bar depending on its current visibility. |
| 236 | virtual void ToggleBookmarkBar() = 0; |
| 237 | |
| 238 | // Shows the About Chrome dialog box. |
[email protected] | 4c6b474b7 | 2011-02-24 21:35:21 | [diff] [blame] | 239 | virtual void ShowAboutChromeDialog() = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 240 | |
| 241 | // Shows the Update Recommended dialog box. |
| 242 | virtual void ShowUpdateChromeDialog() = 0; |
| 243 | |
| 244 | // Shows the Task manager. |
| 245 | virtual void ShowTaskManager() = 0; |
| 246 | |
[email protected] | adb6a84d | 2011-02-07 16:58:40 | [diff] [blame] | 247 | // Shows task information related to background pages. |
| 248 | virtual void ShowBackgroundPages() = 0; |
| 249 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 250 | // Shows the Bookmark bubble. |url| is the URL being bookmarked, |
| 251 | // |already_bookmarked| is true if the url is already bookmarked. |
| 252 | virtual void ShowBookmarkBubble(const GURL& url, bool already_bookmarked) = 0; |
| 253 | |
| 254 | // Whether or not the shelf view is visible. |
| 255 | virtual bool IsDownloadShelfVisible() const = 0; |
| 256 | |
| 257 | // Returns the DownloadShelf. |
| 258 | virtual DownloadShelf* GetDownloadShelf() = 0; |
| 259 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 260 | // Shows the collected cookies dialog box. |
[email protected] | a3627e6 | 2011-09-07 00:04:57 | [diff] [blame] | 261 | virtual void ShowCollectedCookiesDialog(TabContentsWrapper* tab_contents) = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 262 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 263 | // Shows the confirmation dialog box warning that the browser is closing with |
| 264 | // in-progress downloads. |
| 265 | // This method should call Browser::InProgressDownloadResponse once the user |
| 266 | // has confirmed. |
| 267 | virtual void ConfirmBrowserCloseWithPendingDownloads() = 0; |
| 268 | |
[email protected] | a0ea76c | 2011-03-23 17:36:42 | [diff] [blame] | 269 | // ThemeService calls this when a user has changed his or her theme, |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 270 | // indicating that it's time to redraw everything. |
| 271 | virtual void UserChangedTheme() = 0; |
| 272 | |
| 273 | // Get extra vertical height that the render view should add to its requests |
| 274 | // to webkit. This can help prevent sending extraneous layout/repaint requests |
| 275 | // when the delegate is in the process of resizing the tab contents view (e.g. |
| 276 | // during infobar animations). |
| 277 | virtual int GetExtraRenderViewHeight() const = 0; |
| 278 | |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 279 | // Notification that |contents| got the focus through user action (click |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 280 | // on the page). |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 281 | virtual void WebContentsFocused(content::WebContents* contents) = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 282 | |
| 283 | // Shows the page info using the specified information. |
| 284 | // |url| is the url of the page/frame the info applies to, |ssl| is the SSL |
| 285 | // information for that page/frame. If |show_history| is true, a section |
| 286 | // showing how many times that URL has been visited is added to the page info. |
| 287 | virtual void ShowPageInfo(Profile* profile, |
| 288 | const GURL& url, |
[email protected] | d583e3f2 | 2011-12-27 21:38:17 | [diff] [blame] | 289 | const content::SSLStatus& ssl, |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 290 | bool show_history) = 0; |
| 291 | |
| 292 | // Shows the app menu (for accessibility). |
| 293 | virtual void ShowAppMenu() = 0; |
| 294 | |
| 295 | // Allows the BrowserWindow object to handle the specified keyboard event |
| 296 | // before sending it to the renderer. |
| 297 | // Returns true if the |event| was handled. Otherwise, if the |event| would |
| 298 | // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, |
| 299 | // |*is_keyboard_shortcut| should be set to true. |
| 300 | virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 301 | bool* is_keyboard_shortcut) = 0; |
| 302 | |
| 303 | // Allows the BrowserWindow object to handle the specified keyboard event, |
| 304 | // if the renderer did not process it. |
| 305 | virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) = 0; |
| 306 | |
| 307 | // Shows the create web app shortcut dialog box. |
[email protected] | f847e608 | 2011-03-24 00:08:26 | [diff] [blame] | 308 | virtual void ShowCreateWebAppShortcutsDialog( |
| 309 | TabContentsWrapper* tab_contents) = 0; |
[email protected] | a3b734b | 2010-11-30 03:17:11 | [diff] [blame] | 310 | |
| 311 | // Shows the create chrome app shortcut dialog box. |
| 312 | virtual void ShowCreateChromeAppShortcutsDialog(Profile* profile, |
| 313 | const Extension* app) = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 314 | |
| 315 | // 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] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 320 | #if defined(OS_MACOSX) |
| 321 | // Opens the tabpose view. |
| 322 | virtual void OpenTabpose() = 0; |
[email protected] | d376693 | 2011-08-04 22:18:23 | [diff] [blame] | 323 | |
| 324 | // Sets the presentation mode for the window. If the window is not already in |
| 325 | // fullscreen, also enters fullscreen mode. |
[email protected] | 8d944b3 | 2011-10-17 06:11:53 | [diff] [blame] | 326 | virtual void EnterPresentationMode( |
| 327 | const GURL& url, |
| 328 | FullscreenExitBubbleType bubble_type) = 0; |
| 329 | virtual void ExitPresentationMode() = 0; |
[email protected] | d376693 | 2011-08-04 22:18:23 | [diff] [blame] | 330 | virtual bool InPresentationMode() = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 331 | #endif |
| 332 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 333 | // Invoked when instant's tab contents should be shown. |
[email protected] | e3690ed | 2011-03-25 20:25:14 | [diff] [blame] | 334 | virtual void ShowInstant(TabContentsWrapper* preview) = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 335 | |
| 336 | // Invoked when the instant's tab contents should be hidden. |
[email protected] | 3e48128 | 2011-10-15 15:39:50 | [diff] [blame] | 337 | virtual void HideInstant() = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 338 | |
| 339 | // Returns the desired bounds for instant in screen coordinates. Note that if |
| 340 | // instant isn't currently visible this returns the bounds instant would be |
| 341 | // placed at. |
| 342 | virtual gfx::Rect GetInstantBounds() = 0; |
| 343 | |
[email protected] | 588300d | 2011-04-28 21:06:35 | [diff] [blame] | 344 | // Return the correct disposition for a popup window based on |bounds|. |
| 345 | virtual WindowOpenDisposition GetDispositionForPopupBounds( |
| 346 | const gfx::Rect& bounds) = 0; |
| 347 | |
[email protected] | 632983f | 2011-08-08 22:51:24 | [diff] [blame] | 348 | // Construct a FindBar implementation for the |browser|. |
| 349 | virtual FindBar* CreateFindBar() = 0; |
| 350 | |
[email protected] | d14af52 | 2010-12-02 03:54:50 | [diff] [blame] | 351 | #if defined(OS_CHROMEOS) |
[email protected] | e7137b2c | 2011-10-24 20:16:55 | [diff] [blame] | 352 | // Shows the mobile setup dialog. |
| 353 | virtual void ShowMobileSetup() = 0; |
| 354 | |
[email protected] | d14af52 | 2010-12-02 03:54:50 | [diff] [blame] | 355 | // Shows the keyboard overlay dialog box. |
| 356 | virtual void ShowKeyboardOverlay(gfx::NativeWindow owning_window) = 0; |
| 357 | #endif |
| 358 | |
[email protected] | 0548c535 | 2011-09-07 00:33:33 | [diff] [blame] | 359 | // Invoked when the preferred size of the contents in current tab has been |
| 360 | // changed. We might choose to update the window size to accomodate this |
| 361 | // change. |
| 362 | // Note that this won't be fired if we change tabs. |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 363 | virtual void UpdatePreferredSize(content::WebContents* web_contents, |
[email protected] | 0548c535 | 2011-09-07 00:33:33 | [diff] [blame] | 364 | const gfx::Size& pref_size) {} |
| 365 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 366 | // Construct a BrowserWindow implementation for the specified |browser|. |
| 367 | static BrowserWindow* CreateBrowserWindow(Browser* browser); |
| 368 | |
[email protected] | 0ec4898e | 2011-12-30 21:09:24 | [diff] [blame] | 369 | // Shows the avatar bubble inside |web_contents|. The bubble is positioned |
| 370 | // relative to |rect|. |rect| should be in the |web_contents| coordinate |
[email protected] | 2f733a0 | 2011-10-06 15:17:34 | [diff] [blame] | 371 | // system. |
[email protected] | 0ec4898e | 2011-12-30 21:09:24 | [diff] [blame] | 372 | virtual void ShowAvatarBubble(content::WebContents* web_contents, |
[email protected] | 2f733a0 | 2011-10-06 15:17:34 | [diff] [blame] | 373 | const gfx::Rect& rect) = 0; |
| 374 | |
[email protected] | 7d2d0815 | 2011-10-25 22:58:47 | [diff] [blame] | 375 | // Shows the avatar bubble on the window frame off of the avatar button. |
| 376 | virtual void ShowAvatarBubbleFromAvatarButton() = 0; |
| 377 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 378 | protected: |
| 379 | friend class BrowserList; |
| 380 | friend class BrowserView; |
| 381 | virtual void DestroyBrowser() = 0; |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 382 | }; |
| 383 | |
| 384 | #if defined(OS_WIN) || defined(TOOLKIT_VIEWS) |
| 385 | class BookmarkBarView; |
| 386 | class LocationBarView; |
| 387 | |
| 388 | namespace views { |
| 389 | class View; |
| 390 | } |
| 391 | #endif // defined(OS_WIN) |
| 392 | |
| 393 | // A BrowserWindow utility interface used for accessing elements of the browser |
| 394 | // UI used only by UI test automation. |
| 395 | class BrowserWindowTesting { |
| 396 | public: |
| 397 | #if defined(OS_WIN) || defined(TOOLKIT_VIEWS) |
| 398 | // Returns the BookmarkBarView. |
| 399 | virtual BookmarkBarView* GetBookmarkBarView() const = 0; |
| 400 | |
| 401 | // Returns the LocationBarView. |
| 402 | virtual LocationBarView* GetLocationBarView() const = 0; |
| 403 | |
| 404 | // Returns the TabContentsContainer. |
| 405 | virtual views::View* GetTabContentsContainerView() const = 0; |
| 406 | |
[email protected] | 69b04b9 | 2010-11-08 22:12:18 | [diff] [blame] | 407 | // Returns the ToolbarView. |
| 408 | virtual ToolbarView* GetToolbarView() const = 0; |
| 409 | #endif |
| 410 | |
| 411 | protected: |
| 412 | virtual ~BrowserWindowTesting() {} |
| 413 | }; |
| 414 | |
| 415 | #endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_ |