1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_
12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/timer/timer.h"
15 #include "build/build_config.h"
16 #include "chrome/browser/devtools/devtools_window.h"
17 #include "chrome/browser/signin/signin_header_helper.h"
18 #include "chrome/browser/ui/browser.h"
19 #include "chrome/browser/ui/browser_window.h"
20 #include "chrome/browser/ui/browser_window_testing_views.h"
21 #include "chrome/browser/ui/omnibox/omnibox_popup_model_observer.h"
22 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
23 #include "chrome/browser/ui/views/frame/browser_frame.h"
24 #include "chrome/browser/ui/views/frame/contents_web_view.h"
25 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
26 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h"
27 #include "chrome/browser/ui/views/load_complete_listener.h"
28 #include "components/infobars/core/infobar_container.h"
29 #include "ui/base/accelerators/accelerator.h"
30 #include "ui/base/models/simple_menu_model.h"
31 #include "ui/gfx/native_widget_types.h"
32 #include "ui/views/controls/button/button.h"
33 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h"
34 #include "ui/views/widget/widget_delegate.h"
35 #include "ui/views/widget/widget_observer.h"
36 #include "ui/views/window/client_view.h"
39 #include "chrome/browser/hang_monitor/hung_plugin_action.h"
40 #include "chrome/browser/hang_monitor/hung_window_detector.h"
43 // NOTE: For more information about the objects and files in this directory,
44 // view: http://dev.chromium.org/developers/design-documents/browser-window
46 class BookmarkBarView;
48 class BrowserViewLayout;
49 class ContentsLayoutManager;
50 class DownloadShelfView;
51 class FullscreenExitBubbleViews;
52 class InfoBarContainerView;
53 class LocationBarView;
54 class PermissionBubbleViewViews;
55 class StatusBubbleViews;
56 class SearchViewController;
60 class TopContainerView;
61 class WebContentsCloseHandler;
68 class RenderFrameHost;
71 namespace extensions {
76 class AccessiblePaneView;
77 class ExternalFocusTracker;
81 ///////////////////////////////////////////////////////////////////////////////
84 // A ClientView subclass that provides the contents of a browser window,
85 // including the TabStrip, toolbars, download shelves, the content area etc.
87 class BrowserView : public BrowserWindow,
88 public BrowserWindowTesting,
89 public TabStripModelObserver,
90 public ui::AcceleratorProvider,
91 public views::WidgetDelegate,
92 public views::WidgetObserver,
93 public views::ClientView,
94 public infobars::InfoBarContainer::Delegate,
95 public LoadCompleteListener::Delegate,
96 public OmniboxPopupModelObserver {
98 // The browser view's class name.
99 static const char kViewClassName[];
102 ~BrowserView() override;
104 // Takes ownership of |browser|.
105 void Init(Browser* browser);
107 void set_frame(BrowserFrame* frame) { frame_ = frame; }
108 BrowserFrame* frame() const { return frame_; }
110 // Returns a pointer to the BrowserView* interface implementation (an
111 // instance of this object, typically) for a given native window, or NULL if
112 // there is no such association.
114 // Don't use this unless you only have a NativeWindow. In nearly all
115 // situations plumb through browser and use it.
116 static BrowserView* GetBrowserViewForNativeWindow(gfx::NativeWindow window);
118 // Returns the BrowserView used for the specified Browser.
119 static BrowserView* GetBrowserViewForBrowser(const Browser* browser);
121 // Returns a Browser instance of this view.
122 Browser* browser() { return browser_.get(); }
123 const Browser* browser() const { return browser_.get(); }
125 // Initializes (or re-initializes) the status bubble. We try to only create
126 // the bubble once and re-use it for the life of the browser, but certain
127 // events (such as changing enabling/disabling Aero on Win) can force a need
128 // to change some of the bubble's creation parameters.
129 void InitStatusBubble();
131 // Initializes the permission bubble view. This class is intended to be
132 // created once and then re-used for the life of the browser window. The
133 // bubbles it creates will be associated with a single visible tab.
134 void InitPermissionBubbleView();
136 // Returns the apparent bounds of the toolbar, in BrowserView coordinates.
137 // These differ from |toolbar_.bounds()| in that they match where the toolbar
138 // background image is drawn -- slightly outside the "true" bounds
139 // horizontally. Note that this returns the bounds for the toolbar area.
140 gfx::Rect GetToolbarBounds() const;
142 // Returns the constraining bounding box that should be used to lay out the
143 // FindBar within. This is _not_ the size of the find bar, just the bounding
144 // box it should be laid out within. The coordinate system of the returned
145 // rect is in the coordinate system of the frame, since the FindBar is a child
147 gfx::Rect GetFindBarBoundingBox() const;
149 // Returns the preferred height of the TabStrip. Used to position the OTR
151 int GetTabStripHeight() const;
153 // Takes some view's origin (relative to this BrowserView) and offsets it such
154 // that it can be used as the source origin for seamlessly tiling the toolbar
155 // background image over that view.
156 gfx::Point OffsetPointForToolbarBackgroundImage(
157 const gfx::Point& point) const;
159 // Container for the tabstrip, toolbar, etc.
160 TopContainerView* top_container() { return top_container_; }
162 // Accessor for the TabStrip.
163 TabStrip* tabstrip() { return tabstrip_; }
165 // Accessor for the Toolbar.
166 ToolbarView* toolbar() { return toolbar_; }
168 // Bookmark bar may be NULL, for example for pop-ups.
169 BookmarkBarView* bookmark_bar() { return bookmark_bar_view_.get(); }
171 // Returns the do-nothing view which controls the z-order of the find bar
172 // widget relative to views which paint into layers and views which have an
173 // associated NativeView. The presence / visibility of this view is not
174 // indicative of the visibility of the find bar widget or even whether
175 // FindBarController is initialized.
176 View* find_bar_host_view() { return find_bar_host_view_; }
178 // Accessor for the InfobarContainer.
179 InfoBarContainerView* infobar_container() { return infobar_container_; }
181 // Accessor for the FullscreenExitBubbleViews.
182 FullscreenExitBubbleViews* fullscreen_exit_bubble() {
183 return fullscreen_bubble_.get();
186 // Returns true if various window components are visible.
187 bool IsTabStripVisible() const;
189 // Returns true if the profile associated with this Browser window is
191 bool IsOffTheRecord() const;
193 // Returns true if the profile associated with this Browser window is
195 bool IsGuestSession() const;
197 // Returns true if the profile associated with this Browser window is
198 // not off the record or a guest session.
199 bool IsRegularOrGuestSession() const;
201 // Returns true if the non-client view should render an avatar icon.
202 bool ShouldShowAvatar() const;
204 // Provides the containing frame with the accelerator for the specified
205 // command id. This can be used to provide menu item shortcut hints etc.
206 // Returns true if an accelerator was found for the specified |cmd_id|, false
208 bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator) const;
210 // Returns true if the specificed |accelerator| is registered with this view.
211 bool IsAcceleratorRegistered(const ui::Accelerator& accelerator);
213 // Returns the active WebContents. Used by our NonClientView's
214 // TabIconView::TabContentsProvider implementations.
215 // TODO(beng): exposing this here is a bit bogus, since it's only used to
216 // determine loading state. It'd be nicer if we could change this to be
217 // bool IsSelectedTabLoading() const; or something like that. We could even
218 // move it to a WindowDelegate subclass.
219 content::WebContents* GetActiveWebContents() const;
221 // Retrieves the icon to use in the frame to indicate an OTR window.
222 gfx::ImageSkia GetOTRAvatarIcon() const;
224 // Returns true if the Browser object associated with this BrowserView is a
225 // tabbed-type window (i.e. a browser window, not an app or popup).
226 bool IsBrowserTypeNormal() const {
227 return browser_->is_type_tabbed();
230 // See ImmersiveModeController for description.
231 ImmersiveModeController* immersive_mode_controller() const {
232 return immersive_mode_controller_.get();
235 // Restores the focused view. This is also used to set the initial focus
236 // when a new browser window is created.
239 // Called after the widget's fullscreen state is changed without going through
240 // FullscreenController. This method does any processing which was skipped.
241 // Only exiting fullscreen in this way is currently supported.
242 void FullscreenStateChanged();
244 // Called from BookmarkBarView/DownloadShelfView during their show/hide
246 void ToolbarSizeChanged(bool is_animating);
248 // Overridden from BrowserWindow:
249 void Show() override;
250 void ShowInactive() override;
251 void Hide() override;
252 void SetBounds(const gfx::Rect& bounds) override;
253 void Close() override;
254 void Activate() override;
255 void Deactivate() override;
256 bool IsActive() const override;
257 void FlashFrame(bool flash) override;
258 bool IsAlwaysOnTop() const override;
259 void SetAlwaysOnTop(bool always_on_top) override;
260 gfx::NativeWindow GetNativeWindow() const override;
261 BrowserWindowTesting* GetBrowserWindowTesting() override;
262 StatusBubble* GetStatusBubble() override;
263 void UpdateTitleBar() override;
264 void BookmarkBarStateChanged(
265 BookmarkBar::AnimateChangeType change_type) override;
266 void UpdateDevTools() override;
267 void UpdateLoadingAnimations(bool should_animate) override;
268 void SetStarredState(bool is_starred) override;
269 void SetTranslateIconToggled(bool is_lit) override;
270 void OnActiveTabChanged(content::WebContents* old_contents,
271 content::WebContents* new_contents,
273 int reason) override;
274 void ZoomChangedForActiveTab(bool can_show_bubble) override;
275 gfx::Rect GetRestoredBounds() const override;
276 ui::WindowShowState GetRestoredState() const override;
277 gfx::Rect GetBounds() const override;
278 bool IsMaximized() const override;
279 bool IsMinimized() const override;
280 void Maximize() override;
281 void Minimize() override;
282 void Restore() override;
283 void EnterFullscreen(const GURL& url,
284 FullscreenExitBubbleType bubble_type) override;
285 void ExitFullscreen() override;
286 void UpdateFullscreenExitBubbleContent(
288 FullscreenExitBubbleType bubble_type) override;
289 bool ShouldHideUIForFullscreen() const override;
290 bool IsFullscreen() const override;
291 bool IsFullscreenBubbleVisible() const override;
293 virtual void SetMetroSnapMode(bool enable) override;
294 virtual bool IsInMetroSnapMode() const override;
296 LocationBar* GetLocationBar() const override;
297 void SetFocusToLocationBar(bool select_all) override;
298 void UpdateReloadStopState(bool is_loading, bool force) override;
299 void UpdateToolbar(content::WebContents* contents) override;
300 void FocusToolbar() override;
301 void FocusAppMenu() override;
302 void FocusBookmarksToolbar() override;
303 void FocusInfobars() override;
304 void RotatePaneFocus(bool forwards) override;
305 void DestroyBrowser() override;
306 bool IsBookmarkBarVisible() const override;
307 bool IsBookmarkBarAnimating() const override;
308 bool IsTabStripEditable() const override;
309 bool IsToolbarVisible() const override;
310 gfx::Rect GetRootWindowResizerRect() const override;
311 void ConfirmAddSearchProvider(TemplateURL* template_url,
312 Profile* profile) override;
313 void ShowUpdateChromeDialog() override;
314 void ShowBookmarkBubble(const GURL& url, bool already_bookmarked) override;
315 void ShowBookmarkAppBubble(const WebApplicationInfo& web_app_info,
316 const std::string& extension_id) override;
317 void ShowTranslateBubble(content::WebContents* contents,
318 translate::TranslateStep step,
319 translate::TranslateErrors::Type error_type,
320 bool is_user_gesture) override;
321 #if defined(ENABLE_ONE_CLICK_SIGNIN)
322 void ShowOneClickSigninBubble(
323 OneClickSigninBubbleType type,
324 const base::string16& email,
325 const base::string16& error_message,
326 const StartSyncCallback& start_sync_callback) override;
328 // TODO(beng): Not an override, move somewhere else.
329 void SetDownloadShelfVisible(bool visible);
330 bool IsDownloadShelfVisible() const override;
331 DownloadShelf* GetDownloadShelf() override;
332 void ConfirmBrowserCloseWithPendingDownloads(
334 Browser::DownloadClosePreventionType dialog_type,
336 const base::Callback<void(bool)>& callback) override;
337 void UserChangedTheme() override;
338 int GetExtraRenderViewHeight() const override;
339 void WebContentsFocused(content::WebContents* contents) override;
340 void ShowWebsiteSettings(Profile* profile,
341 content::WebContents* web_contents,
343 const content::SSLStatus& ssl) override;
344 void ShowAppMenu() override;
345 bool PreHandleKeyboardEvent(const content::NativeWebKeyboardEvent& event,
346 bool* is_keyboard_shortcut) override;
347 void HandleKeyboardEvent(
348 const content::NativeWebKeyboardEvent& event) override;
350 void Copy() override;
351 void Paste() override;
352 WindowOpenDisposition GetDispositionForPopupBounds(
353 const gfx::Rect& bounds) override;
354 FindBar* CreateFindBar() override;
355 web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost()
357 void ShowAvatarBubble(content::WebContents* web_contents,
358 const gfx::Rect& rect) override;
359 void ShowAvatarBubbleFromAvatarButton(
360 AvatarBubbleMode mode,
361 const signin::ManageAccountsParams& manage_accounts_params) override;
362 int GetRenderViewHeightInsetWithDetachedBookmarkBar() override;
363 void ExecuteExtensionCommand(const extensions::Extension* extension,
364 const extensions::Command& command) override;
366 // Overridden from BrowserWindowTesting:
367 BookmarkBarView* GetBookmarkBarView() const override;
368 LocationBarView* GetLocationBarView() const override;
369 views::View* GetTabContentsContainerView() const override;
370 ToolbarView* GetToolbarView() const override;
372 // Overridden from TabStripModelObserver:
373 void TabInsertedAt(content::WebContents* contents,
375 bool foreground) override;
376 void TabDetachedAt(content::WebContents* contents, int index) override;
377 void TabDeactivated(content::WebContents* contents) override;
378 void TabStripEmpty() override;
379 void WillCloseAllTabs() override;
380 void CloseAllTabsCanceled() override;
382 // Overridden from ui::AcceleratorProvider:
383 bool GetAcceleratorForCommandId(int command_id,
384 ui::Accelerator* accelerator) override;
386 // Overridden from views::WidgetDelegate:
387 bool CanResize() const override;
388 bool CanMaximize() const override;
389 bool CanMinimize() const override;
390 bool CanActivate() const override;
391 base::string16 GetWindowTitle() const override;
392 base::string16 GetAccessibleWindowTitle() const override;
393 views::View* GetInitiallyFocusedView() override;
394 bool ShouldShowWindowTitle() const override;
395 gfx::ImageSkia GetWindowAppIcon() override;
396 gfx::ImageSkia GetWindowIcon() override;
397 bool ShouldShowWindowIcon() const override;
398 bool ExecuteWindowsCommand(int command_id) override;
399 std::string GetWindowName() const override;
400 void SaveWindowPlacement(const gfx::Rect& bounds,
401 ui::WindowShowState show_state) override;
402 bool GetSavedWindowPlacement(const views::Widget* widget,
404 ui::WindowShowState* show_state) const override;
405 views::View* GetContentsView() override;
406 views::ClientView* CreateClientView(views::Widget* widget) override;
407 void OnWindowBeginUserBoundsChange() override;
408 void OnWidgetMove() override;
409 views::Widget* GetWidget() override;
410 const views::Widget* GetWidget() const override;
411 void GetAccessiblePanes(std::vector<View*>* panes) override;
413 // Overridden from views::WidgetObserver:
414 void OnWidgetActivationChanged(views::Widget* widget, bool active) override;
416 // Overridden from views::ClientView:
417 bool CanClose() override;
418 int NonClientHitTest(const gfx::Point& point) override;
419 gfx::Size GetMinimumSize() const override;
421 // InfoBarContainer::Delegate overrides
422 SkColor GetInfoBarSeparatorColor() const override;
423 void InfoBarContainerStateChanged(bool is_animating) override;
424 bool DrawInfoBarArrows(int* x) const override;
426 // Overridden from views::View:
427 const char* GetClassName() const override;
428 void Layout() override;
429 void PaintChildren(gfx::Canvas* canvas,
430 const views::CullSet& cull_set) override;
431 void ViewHierarchyChanged(
432 const ViewHierarchyChangedDetails& details) override;
433 void ChildPreferredSizeChanged(View* child) override;
434 void GetAccessibleState(ui::AXViewState* state) override;
435 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
437 // Overridden from ui::AcceleratorTarget:
438 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
440 // OmniboxPopupModelObserver overrides
441 void OnOmniboxPopupShownOrHidden() override;
443 // Testing interface:
444 views::View* GetContentsContainerForTest() { return contents_container_; }
445 views::WebView* GetContentsWebViewForTest() { return contents_web_view_; }
446 views::WebView* GetDevToolsWebViewForTest() { return devtools_web_view_; }
449 // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate
450 // interface to keep these two classes decoupled and testable.
451 friend class BrowserViewLayoutDelegateImpl;
452 FRIEND_TEST_ALL_PREFIXES(BrowserViewTest, BrowserView);
453 FRIEND_TEST_ALL_PREFIXES(BrowserViewsAccessibilityTest,
454 TestAboutChromeViewAccObj);
456 enum FullscreenMode {
458 METRO_SNAP_FULLSCREEN
461 // Appends to |toolbars| a pointer to each AccessiblePaneView that
462 // can be traversed using F6, in the order they should be traversed.
463 void GetAccessiblePanes(std::vector<views::AccessiblePaneView*>* panes);
465 // Constructs and initializes the child views.
468 // Callback for the loading animation(s) associated with this view.
469 void LoadingAnimationCallback();
471 // LoadCompleteListener::Delegate implementation. Creates and initializes the
472 // |jumplist_| after the first page load.
473 void OnLoadCompleted() override;
475 // Returns the BrowserViewLayout.
476 BrowserViewLayout* GetBrowserViewLayout() const;
478 // Returns the ContentsLayoutManager.
479 ContentsLayoutManager* GetContentsLayoutManager() const;
481 // Prepare to show the Bookmark Bar for the specified WebContents.
482 // Returns true if the Bookmark Bar can be shown (i.e. it's supported for this
483 // Browser type) and there should be a subsequent re-layout to show it.
484 // |contents| can be NULL.
485 bool MaybeShowBookmarkBar(content::WebContents* contents);
487 // Moves the bookmark bar view to the specified parent, which may be NULL,
488 // |this|, or |top_container_|. Ensures that |top_container_| stays in front
489 // of |bookmark_bar_view_|.
490 void SetBookmarkBarParent(views::View* new_parent);
492 // Prepare to show an Info Bar for the specified WebContents. Returns
493 // true if there is an Info Bar to show and one is supported for this Browser
494 // type, and there should be a subsequent re-layout to show it.
495 // |contents| can be NULL.
496 bool MaybeShowInfoBar(content::WebContents* contents);
498 // Updates devtools window for given contents. This method will show docked
499 // devtools window for inspected |web_contents| that has docked devtools
500 // and hide it for NULL or not inspected |web_contents|. It will also make
501 // sure devtools window size and position are restored for given tab.
502 // This method will not update actual DevTools WebContents, if not
503 // |update_devtools_web_contents|. In this case, manual update is required.
504 void UpdateDevToolsForContents(content::WebContents* web_contents,
505 bool update_devtools_web_contents);
507 // Updates various optional child Views, e.g. Bookmarks Bar, Info Bar or the
508 // Download Shelf in response to a change notification from the specified
509 // |contents|. |contents| can be NULL. In this case, all optional UI will be
511 void UpdateUIForContents(content::WebContents* contents);
513 // Invoked to update the necessary things when our fullscreen state changes
514 // to |fullscreen|. On Windows this is invoked immediately when we toggle the
515 // full screen state. On Linux changing the fullscreen state is async, so we
516 // ask the window to change its fullscreen state, then when we get
517 // notification that it succeeded this method is invoked.
518 // If |url| is not empty, it is the URL of the page that requested fullscreen
519 // (via the fullscreen JS API).
520 // |bubble_type| determines what should be shown in the fullscreen exit
522 void ProcessFullscreen(bool fullscreen,
525 FullscreenExitBubbleType bubble_type);
527 // Returns whether immmersive fullscreen should replace fullscreen. This
528 // should only occur for "browser-fullscreen" for tabbed-typed windows (not
529 // for tab-fullscreen and not for app/popup type windows).
530 bool ShouldUseImmersiveFullscreenForUrl(const GURL& url) const;
532 // Copy the accelerator table from the app resources into something we can
534 void LoadAccelerators();
536 // Retrieves the command id for the specified Windows app command.
537 int GetCommandIDForAppCommandID(int app_command_id) const;
539 // Initialize the hung plugin detector.
540 void InitHangMonitor();
542 // Possibly records a user metrics action corresponding to the passed-in
543 // accelerator. Only implemented for Chrome OS, where we're interested in
544 // learning about how frequently the top-row keys are used.
545 void UpdateAcceleratorMetrics(const ui::Accelerator& accelerator,
548 // Calls |method| which is either WebContents::Cut, ::Copy, or ::Paste,
549 // first trying the content WebContents, then the devtools WebContents, and
550 // lastly the Views::Textfield if one is focused.
551 void DoCutCopyPaste(void (content::WebContents::*method)(),
554 // Calls |method| which is either WebContents::Cut, ::Copy, or ::Paste on
555 // the given WebContents, returning true if it consumed the event.
556 bool DoCutCopyPasteForWebContents(
557 content::WebContents* contents,
558 void (content::WebContents::*method)());
560 // Shows the next app-modal dialog box, if there is one to be shown, or moves
561 // an existing showing one to the front.
562 void ActivateAppModalDialog() const;
564 // Returns the max top arrow height for infobar.
565 int GetMaxTopInfoBarArrowHeight();
567 // Last focused view that issued a tab traversal.
568 int last_focused_view_storage_id_;
570 // The BrowserFrame that hosts this view.
571 BrowserFrame* frame_;
573 // The Browser object we are associated with.
574 scoped_ptr<Browser> browser_;
576 // BrowserView layout (LTR one is pictured here).
578 // --------------------------------------------------------------------
579 // | TopContainerView (top_container_) |
580 // | -------------------------------------------------------------- |
581 // | | Tabs (tabstrip_) | |
582 // | |------------------------------------------------------------| |
583 // | | Navigation buttons, address bar, menu (toolbar_) | |
584 // | -------------------------------------------------------------- |
585 // |------------------------------------------------------------------|
586 // | All infobars (infobar_container_) [1] |
587 // |------------------------------------------------------------------|
588 // | Bookmarks (bookmark_bar_view_) [1] |
589 // |------------------------------------------------------------------|
590 // | Contents container (contents_container_) |
591 // | -------------------------------------------------------------- |
592 // | | devtools_web_view_ | |
593 // | |------------------------------------------------------------| |
594 // | | contents_web_view_ | |
595 // | -------------------------------------------------------------- |
596 // |------------------------------------------------------------------|
597 // | Active downloads (download_shelf_) |
598 // --------------------------------------------------------------------
600 // [1] The bookmark bar and info bar are swapped when on the new tab page.
601 // Additionally when the bookmark bar is detached, contents_container_ is
602 // positioned on top of the bar while the tab's contents are placed below
603 // the bar. This allows the find bar to always align with the top of
604 // contents_container_ regardless if there's bookmark or info bars.
606 // The view that manages the tab strip, toolbar, and sometimes the bookmark
607 // bar. Stacked top in the view hiearachy so it can be used to slide out
608 // the top views in immersive fullscreen.
609 TopContainerView* top_container_;
614 // The Toolbar containing the navigation buttons, menus and the address bar.
615 ToolbarView* toolbar_;
617 // The Bookmark Bar View for this window. Lazily created. May be NULL for
618 // non-tabbed browsers like popups. May not be visible.
619 scoped_ptr<BookmarkBarView> bookmark_bar_view_;
621 // The do-nothing view which controls the z-order of the find bar widget
622 // relative to views which paint into layers and views with an associated
624 View* find_bar_host_view_;
626 // The download shelf view (view at the bottom of the page).
627 scoped_ptr<DownloadShelfView> download_shelf_;
629 // The InfoBarContainerView that contains InfoBars for the current tab.
630 InfoBarContainerView* infobar_container_;
632 // The view that contains the selected WebContents.
633 ContentsWebView* contents_web_view_;
635 // The view that contains devtools window for the selected WebContents.
636 views::WebView* devtools_web_view_;
638 // The view managing the devtools and contents positions.
639 // Handled by ContentsLayoutManager.
640 views::View* contents_container_;
642 // Tracks and stores the last focused view which is not the
643 // devtools_web_view_ or any of its children. Used to restore focus once
644 // the devtools_web_view_ is hidden.
645 scoped_ptr<views::ExternalFocusTracker> devtools_focus_tracker_;
647 // The Status information bubble that appears at the bottom of the window.
648 scoped_ptr<StatusBubbleViews> status_bubble_;
650 // The permission bubble view is the toolkit-specific implementation of the
651 // interface used by the manager to display permissions bubbles.
652 scoped_ptr<PermissionBubbleViewViews> permission_bubble_view_;
654 // A mapping between accelerators and commands.
655 std::map<ui::Accelerator, int> accelerator_table_;
657 // True if we have already been initialized.
660 // True when in ProcessFullscreen(). The flag is used to avoid reentrance and
661 // to ignore requests to layout while in ProcessFullscreen() to reduce
663 bool in_process_fullscreen_;
665 scoped_ptr<FullscreenExitBubbleViews> fullscreen_bubble_;
668 // This object is used to perform periodic actions in a worker
669 // thread. It is currently used to monitor hung plugin windows.
670 WorkerThreadTicker ticker_;
672 // This object is initialized with the frame window HWND. This
673 // object is also passed as a tick handler with the ticker_ object.
674 // It is used to periodically monitor for hung plugin windows
675 HungWindowDetector hung_window_detector_;
677 // This object is invoked by hung_window_detector_ when it detects a hung
679 HungPluginAction hung_plugin_action_;
681 // Helper class to listen for completion of first page load.
682 scoped_ptr<LoadCompleteListener> load_complete_listener_;
684 // The custom JumpList for Windows 7.
685 scoped_refptr<JumpList> jumplist_;
688 // The timer used to update frames for the Loading Animation.
689 base::RepeatingTimer<BrowserView> loading_animation_timer_;
691 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
693 // Used to measure the loading spinner animation rate.
694 base::TimeTicks last_animation_time_;
696 // If this flag is set then SetFocusToLocationBar() will set focus to the
697 // location bar even if the browser window is not active.
698 bool force_location_bar_focus_;
700 scoped_ptr<ImmersiveModeController> immersive_mode_controller_;
702 scoped_ptr<WebContentsCloseHandler> web_contents_close_handler_;
704 mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_;
706 DISALLOW_COPY_AND_ASSIGN(BrowserView);
709 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_