browser_view.h revision 23730a6e56a168d1879203e4b3819bb36e3d8f1f
19e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek// Copyright (c) 2012 The Chromium Authors. All rights reserved.
29e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek// Use of this source code is governed by a BSD-style license that can be
39e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek// found in the LICENSE file.
49e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek
59e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_
69e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_
79e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek
89e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include <map>
99e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include <string>
109e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include <vector>
119e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek
129e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "base/compiler_specific.h"
139e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "base/memory/scoped_ptr.h"
149e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "base/timer/timer.h"
159e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "build/build_config.h"
165a4f98ff943e6a501b0fe47ade007c9bbf96cb88Argyrios Kyrtzidis#include "chrome/browser/devtools/devtools_window.h"
175a4f98ff943e6a501b0fe47ade007c9bbf96cb88Argyrios Kyrtzidis#include "chrome/browser/infobars/infobar_container.h"
189e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "chrome/browser/ui/browser.h"
19478851c3ed6bd784e7377dffd8e57b200c1b9ba9Benjamin Kramer#include "chrome/browser/ui/browser_window.h"
209ff2b13aee0f89d23ef4820218f9b88bb5e5c1c1Ken Dyck#include "chrome/browser/ui/omnibox/omnibox_popup_model_observer.h"
21993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
224c62b557e269a27515dfca1f754ae936c8fdb824Ted Kremenek#include "chrome/browser/ui/views/frame/browser_frame.h"
23d47d3b0cfeb7e8564ff77f48130fe63282b6d127Chris Lattner#include "chrome/browser/ui/views/frame/contents_web_view.h"
249b663716449b618ba0390b1dbebc54fa8e971124Ted Kremenek#include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
259e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "chrome/browser/ui/views/frame/scroll_end_effect_controller.h"
2630a2e16f6c27f888dd11eba6bbbae1e980078fcbChandler Carruth#include "chrome/browser/ui/views/load_complete_listener.h"
279e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "ui/base/accelerators/accelerator.h"
289e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "ui/base/models/simple_menu_model.h"
295e2d2c2ee3cf410643e0f9a5701708e51409d973Benjamin Kramer#include "ui/gfx/native_widget_types.h"
305e2d2c2ee3cf410643e0f9a5701708e51409d973Benjamin Kramer#include "ui/gfx/sys_color_change_listener.h"
315e2d2c2ee3cf410643e0f9a5701708e51409d973Benjamin Kramer#include "ui/views/controls/button/button.h"
329e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "ui/views/controls/webview/unhandled_keyboard_event_handler.h"
339e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek#include "ui/views/widget/widget_delegate.h"
341eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump#include "ui/views/widget/widget_observer.h"
35d17da2b99f323fa91b01e1dd119cc32e0ee8197dTed Kremenek#include "ui/views/window/client_view.h"
3667d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
375a4f98ff943e6a501b0fe47ade007c9bbf96cb88Argyrios Kyrtzidis#if defined(OS_WIN)
389ef6537a894c33003359b1f9b9676e9178e028b7Ted Kremenek#include "chrome/browser/hang_monitor/hung_plugin_action.h"
395a4f98ff943e6a501b0fe47ade007c9bbf96cb88Argyrios Kyrtzidis#include "chrome/browser/hang_monitor/hung_window_detector.h"
405a4f98ff943e6a501b0fe47ade007c9bbf96cb88Argyrios Kyrtzidis#endif
415a4f98ff943e6a501b0fe47ade007c9bbf96cb88Argyrios Kyrtzidis
42c8413fd03f73084a5c93028f8b4db619fc388087Ted Kremenek// NOTE: For more information about the objects and files in this directory,
434240096011a187807058f887eb81df750ffa17feTed Kremenek// view: http://dev.chromium.org/developers/design-documents/browser-window
44dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek
451eb4433ac451dc16f4133a88af2d002ac26c58efMike Stumpclass BookmarkBarView;
46e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xuclass Browser;
47e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xuclass BrowserViewLayout;
48e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xuclass ContentsLayoutManager;
49e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xuclass DownloadShelfView;
50e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xuclass FullscreenExitBubbleViews;
51e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xuclass InfoBarContainerView;
52e3273e78da4716f9c999ae207f6898f376a6e1a4Zhongxing Xuclass LocationBarView;
53e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xuclass PermissionBubbleViewViews;
54e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xuclass StatusBubbleViews;
555375d82d1d096ddd8879d8e6641a8f042b0d1d43Aaron Ballmanclass SearchViewController;
565375d82d1d096ddd8879d8e6641a8f042b0d1d43Aaron Ballmanclass TabStrip;
575375d82d1d096ddd8879d8e6641a8f042b0d1d43Aaron Ballmanclass TabStripModel;
58824e07ac8f5c9efdddb4254de0203b9675b1ef0bJordan Roseclass ToolbarView;
59e0d24eb1060a213ec9820dc02c45f26b2d5b348bJordan Roseclass TopContainerView;
60e3273e78da4716f9c999ae207f6898f376a6e1a4Zhongxing Xu
61e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xu#if defined(OS_WIN)
62e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xuclass JumpList;
63824e07ac8f5c9efdddb4254de0203b9675b1ef0bJordan Rose#endif
64824e07ac8f5c9efdddb4254de0203b9675b1ef0bJordan Rose
65824e07ac8f5c9efdddb4254de0203b9675b1ef0bJordan Rosenamespace autofill {
66824e07ac8f5c9efdddb4254de0203b9675b1ef0bJordan Roseclass PasswordGenerator;
67824e07ac8f5c9efdddb4254de0203b9675b1ef0bJordan Rose}
68824e07ac8f5c9efdddb4254de0203b9675b1ef0bJordan Rose
69824e07ac8f5c9efdddb4254de0203b9675b1ef0bJordan Rosenamespace content {
70e0d24eb1060a213ec9820dc02c45f26b2d5b348bJordan Roseclass RenderFrameHost;
71e0d24eb1060a213ec9820dc02c45f26b2d5b348bJordan Rose}
72e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xu
73e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xunamespace extensions {
7419e1f0ba5cec738ce6cebe3fe0e1edc782206494Ted Kremenekclass Extension;
7519e1f0ba5cec738ce6cebe3fe0e1edc782206494Ted Kremenek}
7619e1f0ba5cec738ce6cebe3fe0e1edc782206494Ted Kremenek
771eb4433ac451dc16f4133a88af2d002ac26c58efMike Stumpnamespace views {
789e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenekclass AccessiblePaneView;
799e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenekclass ExternalFocusTracker;
804240096011a187807058f887eb81df750ffa17feTed Kremenekclass WebView;
819e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek}
8267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
8367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek///////////////////////////////////////////////////////////////////////////////
84dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek// BrowserView
8567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek//
8667d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek//  A ClientView subclass that provides the contents of a browser window,
8767d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek//  including the TabStrip, toolbars, download shelves, the content area etc.
882b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek//
89dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenekclass BrowserView : public BrowserWindow,
90eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                    public BrowserWindowTesting,
91eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                    public TabStripModelObserver,
92eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                    public ui::AcceleratorProvider,
93eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                    public views::WidgetDelegate,
94eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                    public views::WidgetObserver,
95eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                    public views::ClientView,
96eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                    public InfoBarContainer::Delegate,
97dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek                    public gfx::SysColorChangeListener,
98eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                    public LoadCompleteListener::Delegate,
9967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek                    public OmniboxPopupModelObserver {
10067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek public:
10167d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // The browser view's class name.
10267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  static const char kViewClassName[];
10367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
10467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  BrowserView();
10567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual ~BrowserView();
1068ecf59afbab1dbf184dc4c0c47e7213cbd32ba0aJordan Rose
1079697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  // Takes ownership of |browser|.
1089697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  void Init(Browser* browser);
109de0d26310191215a6d1d189dc419f87af18ce6beTed Kremenek
11067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  void set_frame(BrowserFrame* frame) { frame_ = frame; }
1114c62b557e269a27515dfca1f754ae936c8fdb824Ted Kremenek  BrowserFrame* frame() const { return frame_; }
11267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
11367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Returns a pointer to the BrowserView* interface implementation (an
11467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // instance of this object, typically) for a given native window, or NULL if
11567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // there is no such association.
11667d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  //
11767d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Don't use this unless you only have a NativeWindow. In nearly all
1184fd56816e0925c04f2c92e75399f5c9018d5d6fbZhongxing Xu  // situations plumb through browser and use it.
11902fe28c8a6da29d4ad88d0900c133dcf22d24a75Zhongxing Xu  static BrowserView* GetBrowserViewForNativeWindow(gfx::NativeWindow window);
1204fd56816e0925c04f2c92e75399f5c9018d5d6fbZhongxing Xu
121096aef9597b263b4cd6a0feaacf9e7214fa9c75aJordy Rose  // Returns the BrowserView used for the specified Browser.
122096aef9597b263b4cd6a0feaacf9e7214fa9c75aJordy Rose  static BrowserView* GetBrowserViewForBrowser(const Browser* browser);
12367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
12467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Returns a Browser instance of this view.
1259e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  Browser* browser() { return browser_.get(); }
1269e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  const Browser* browser() const { return browser_.get(); }
1271eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump
1289e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // Initializes (or re-initializes) the status bubble.  We try to only create
1299e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // the bubble once and re-use it for the life of the browser, but certain
1309e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // events (such as changing enabling/disabling Aero on Win) can force a need
1319e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // to change some of the bubble's creation parameters.
1329e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  void InitStatusBubble();
133a6275a534da701f37d19a068e6361e5f10f983a1Ted Kremenek
1341eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // Initializes the permission bubble view. This class is intended to be
1359e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // created once and then re-used for the life of the browser window. The
136a43484afda4c4fb4b23a53a2dc91d985d39dc2c4Ted Kremenek  // bubbles it creates will be associated with a single visible tab.
137a43484afda4c4fb4b23a53a2dc91d985d39dc2c4Ted Kremenek  void InitPermissionBubbleView();
138a43484afda4c4fb4b23a53a2dc91d985d39dc2c4Ted Kremenek
139bb7c96f290453104ec35ca17111a5165f68a4697Ted Kremenek  // Returns the apparent bounds of the toolbar, in BrowserView coordinates.
1401eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // These differ from |toolbar_.bounds()| in that they match where the toolbar
141adca27102ff733c7d42fcbbc2c7e134a7fc026f9Zhongxing Xu  // background image is drawn -- slightly outside the "true" bounds
142adca27102ff733c7d42fcbbc2c7e134a7fc026f9Zhongxing Xu  // horizontally. Note that this returns the bounds for the toolbar area.
143522fc21f3adc647817edc8017e6928a64c96899bAnna Zaks  gfx::Rect GetToolbarBounds() const;
1445f7c0add1ea1d8e1d2f920d77fd1a7b6160c2d93Anna Zaks
145522fc21f3adc647817edc8017e6928a64c96899bAnna Zaks  // Returns the constraining bounding box that should be used to lay out the
146b11a3ada9a22e146c6edd33bcc6301e221fedd7aJordan Rose  // FindBar within. This is _not_ the size of the find bar, just the bounding
1471eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // box it should be laid out within. The coordinate system of the returned
1481508636e99faddf569a57fce82c0fb3aa2124396Ted Kremenek  // rect is in the coordinate system of the frame, since the FindBar is a child
1491eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // window.
150de0d26310191215a6d1d189dc419f87af18ce6beTed Kremenek  gfx::Rect GetFindBarBoundingBox() const;
151de0d26310191215a6d1d189dc419f87af18ce6beTed Kremenek
152de0d26310191215a6d1d189dc419f87af18ce6beTed Kremenek  // Returns the preferred height of the TabStrip. Used to position the OTR
153de0d26310191215a6d1d189dc419f87af18ce6beTed Kremenek  // avatar icon.
154de0d26310191215a6d1d189dc419f87af18ce6beTed Kremenek  int GetTabStripHeight() const;
155b21ff77c8126ea628b66d2ffb931fdaa7884f5d2Zhongxing Xu
156e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xu  // Takes some view's origin (relative to this BrowserView) and offsets it such
157e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xu  // that it can be used as the source origin for seamlessly tiling the toolbar
158e888233f6b115d3b0dd73bcb5f35e93794408542Zhongxing Xu  // background image over that view.
1593d7c44e01d568e5d5c0fac9c6ccb3f080157ba19Anna Zaks  gfx::Point OffsetPointForToolbarBackgroundImage(
1603d7c44e01d568e5d5c0fac9c6ccb3f080157ba19Anna Zaks      const gfx::Point& point) const;
1613d7c44e01d568e5d5c0fac9c6ccb3f080157ba19Anna Zaks
1629c378f705405d37f49795d5e915989de774fe11fTed Kremenek  // Container for the tabstrip, toolbar, etc.
1637f39d29cb69e7488f994870800d548008e50e1cbTed Kremenek  TopContainerView* top_container() { return top_container_; }
1648800ad4eaa1621f6d23c8264971063b9f8da6a2eTed Kremenek
1651eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // Accessor for the TabStrip.
166919e8a1c6698bfa6848571d366430126bced727dJordan Rose  TabStrip* tabstrip() { return tabstrip_; }
167919e8a1c6698bfa6848571d366430126bced727dJordan Rose
168919e8a1c6698bfa6848571d366430126bced727dJordan Rose  // Accessor for the Toolbar.
1693d7c44e01d568e5d5c0fac9c6ccb3f080157ba19Anna Zaks  ToolbarView* toolbar() { return toolbar_; }
170919e8a1c6698bfa6848571d366430126bced727dJordan Rose
1713d7c44e01d568e5d5c0fac9c6ccb3f080157ba19Anna Zaks  // Bookmark bar may be NULL, for example for pop-ups.
1721eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  BookmarkBarView* bookmark_bar() { return bookmark_bar_view_.get(); }
1731eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump
174ed65d3d97132fbcdd124aef4d2478e348dfbd36bTed Kremenek  // Returns the do-nothing view which controls the z-order of the find bar
1751eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // widget relative to views which paint into layers and views which have an
176f0f0605c87739c906861f73d4287798a4969b1e0Zhongxing Xu  // associated NativeView. The presence / visibility of this view is not
1779e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // indicative of the visibility of the find bar widget or even whether
1781eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // FindBarController is initialized.
179eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  View* find_bar_host_view() { return find_bar_host_view_; }
1809e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek
1819e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // Accessor for the InfobarContainer.
182a43484afda4c4fb4b23a53a2dc91d985d39dc2c4Ted Kremenek  InfoBarContainerView* infobar_container() { return infobar_container_; }
18367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
18467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Accessor for the FullscreenExitBubbleViews.
185a43484afda4c4fb4b23a53a2dc91d985d39dc2c4Ted Kremenek  FullscreenExitBubbleViews* fullscreen_exit_bubble() {
186a43484afda4c4fb4b23a53a2dc91d985d39dc2c4Ted Kremenek    return fullscreen_bubble_.get();
18767d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  }
18867d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
18967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Returns true if various window components are visible.
19067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  bool IsTabStripVisible() const;
19167d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
19267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Returns true if the profile associated with this Browser window is
1931eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // incognito.
19467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  bool IsOffTheRecord() const;
19567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
19667d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Returns true if the profile associated with this Browser window is
19767d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // a guest session.
19867d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  bool IsGuestSession() const;
19967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
20067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Returns true if the profile associated with this Browser window is
20167d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // not off the record or a guest session.
202a43484afda4c4fb4b23a53a2dc91d985d39dc2c4Ted Kremenek  bool IsRegularOrGuestSession() const;
20367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
20467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Returns the resource ID to use for the OTR icon, which depends on
20567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // which layout is being shown and whether we are full-screen.
20699ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  int GetOTRIconResourceID() const;
207dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek
208dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // Returns the resource ID to use for the Guest icon, which may depend on
209dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // which layout is being shown and whether we are full-screen.
210dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  int GetGuestIconResourceID() const;
211dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek
212dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // Returns true if the non-client view should render an avatar icon.
213dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  bool ShouldShowAvatar() const;
214dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek
215dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // Provides the containing frame with the accelerator for the specified
216eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  // command id. This can be used to provide menu item shortcut hints etc.
217914edfbb07c34d8cad8d0451193b4f9dd02a2d5aDavid Blaikie  // Returns true if an accelerator was found for the specified |cmd_id|, false
218eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  // otherwise.
219914edfbb07c34d8cad8d0451193b4f9dd02a2d5aDavid Blaikie  bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator);
220eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks
221eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  // Returns true if the specificed |accelerator| is registered with this view.
222dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  bool IsAcceleratorRegistered(const ui::Accelerator& accelerator);
22367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
224a43484afda4c4fb4b23a53a2dc91d985d39dc2c4Ted Kremenek  // Returns the active WebContents. Used by our NonClientView's
225dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // TabIconView::TabContentsProvider implementations.
226dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // TODO(beng): exposing this here is a bit bogus, since it's only used to
227dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // determine loading state. It'd be nicer if we could change this to be
228dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // bool IsSelectedTabLoading() const; or something like that. We could even
229dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // move it to a WindowDelegate subclass.
230dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  content::WebContents* GetActiveWebContents() const;
231dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek
232dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // Retrieves the icon to use in the frame to indicate an OTR window.
2339c378f705405d37f49795d5e915989de774fe11fTed Kremenek  gfx::ImageSkia GetOTRAvatarIcon() const;
234fa87d812d7c78d7f0cd1c5636e21e07c23c85341Ted Kremenek
235dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // Returns true if the Browser object associated with this BrowserView is a
236dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  // tabbed-type window (i.e. a browser window, not an app or popup).
237dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  bool IsBrowserTypeNormal() const {
238dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek    return browser_->is_type_tabbed();
239dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  }
240dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek
241eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  // See ImmersiveModeController for description.
242914edfbb07c34d8cad8d0451193b4f9dd02a2d5aDavid Blaikie  ImmersiveModeController* immersive_mode_controller() const {
243eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks    return immersive_mode_controller_.get();
244eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  }
245eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks
246eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  // Restores the focused view. This is also used to set the initial focus
247eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  // when a new browser window is created.
248dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  void RestoreFocus();
249dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek
250dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  void SetWindowSwitcherButton(views::Button* button);
251eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks
252eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  views::Button* window_switcher_button() {
253eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks    return window_switcher_button_;
254dcee3ce97fc76f20ce8f5a7451071e3dec537073Ted Kremenek  }
2559e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek
256fa87d812d7c78d7f0cd1c5636e21e07c23c85341Ted Kremenek  // Called after the widget's fullscreen state is changed without going through
25767d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // FullscreenController. This method does any processing which was skipped.
258eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  // Only exiting fullscreen in this way is currently supported.
259eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  void FullscreenStateChanged();
260eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks
26167d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Called from BookmarkBarView/DownloadShelfView during their show/hide
26267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // animations.
263eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  void ToolbarSizeChanged(bool is_animating);
264914edfbb07c34d8cad8d0451193b4f9dd02a2d5aDavid Blaikie
265eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  // Overridden from BrowserWindow:
266eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void Show() OVERRIDE;
267eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void ShowInactive() OVERRIDE;
268eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void Hide() OVERRIDE;
269eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
270eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void Close() OVERRIDE;
271eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void Activate() OVERRIDE;
272eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void Deactivate() OVERRIDE;
273eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual bool IsActive() const OVERRIDE;
274eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void FlashFrame(bool flash) OVERRIDE;
275eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual bool IsAlwaysOnTop() const OVERRIDE;
276eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
277eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
278eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual BrowserWindowTesting* GetBrowserWindowTesting() OVERRIDE;
279eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual StatusBubble* GetStatusBubble() OVERRIDE;
280eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void UpdateTitleBar() OVERRIDE;
281914edfbb07c34d8cad8d0451193b4f9dd02a2d5aDavid Blaikie  virtual void BookmarkBarStateChanged(
282eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks      BookmarkBar::AnimateChangeType change_type) OVERRIDE;
283eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void UpdateDevTools() OVERRIDE;
284eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void UpdateLoadingAnimations(bool should_animate) OVERRIDE;
285eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void SetStarredState(bool is_starred) OVERRIDE;
286eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void SetTranslateIconToggled(bool is_lit) OVERRIDE;
287eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void OnActiveTabChanged(content::WebContents* old_contents,
288eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                                  content::WebContents* new_contents,
289eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                                  int index,
290eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks                                  int reason) OVERRIDE;
291eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void ZoomChangedForActiveTab(bool can_show_bubble) OVERRIDE;
292eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
293eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual ui::WindowShowState GetRestoredState() const OVERRIDE;
294eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual gfx::Rect GetBounds() const OVERRIDE;
295eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual bool IsMaximized() const OVERRIDE;
296eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual bool IsMinimized() const OVERRIDE;
297eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void Maximize() OVERRIDE;
298eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void Minimize() OVERRIDE;
299eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void Restore() OVERRIDE;
300eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void EnterFullscreen(
301914edfbb07c34d8cad8d0451193b4f9dd02a2d5aDavid Blaikie      const GURL& url, FullscreenExitBubbleType bubble_type) OVERRIDE;
302eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void ExitFullscreen() OVERRIDE;
303eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void UpdateFullscreenExitBubbleContent(
304eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks      const GURL& url,
305eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks      FullscreenExitBubbleType bubble_type) OVERRIDE;
306eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual bool ShouldHideUIForFullscreen() const OVERRIDE;
307eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual bool IsFullscreen() const OVERRIDE;
308eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual bool IsFullscreenBubbleVisible() const OVERRIDE;
309eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks#if defined(OS_WIN)
310eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void SetMetroSnapMode(bool enable) OVERRIDE;
311eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual bool IsInMetroSnapMode() const OVERRIDE;
312eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks#endif
313eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual LocationBar* GetLocationBar() const OVERRIDE;
314eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void SetFocusToLocationBar(bool select_all) OVERRIDE;
315eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void UpdateReloadStopState(bool is_loading, bool force) OVERRIDE;
316eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void UpdateToolbar(content::WebContents* contents) OVERRIDE;
317eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void FocusToolbar() OVERRIDE;
318eb31a76d1cdaaf8874c549dc6bd964ff270d3822Anna Zaks  virtual void FocusAppMenu() OVERRIDE;
31967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void FocusBookmarksToolbar() OVERRIDE;
32099ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  virtual void FocusInfobars() OVERRIDE;
32167d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void RotatePaneFocus(bool forwards) OVERRIDE;
32267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void DestroyBrowser() OVERRIDE;
32367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual bool IsBookmarkBarVisible() const OVERRIDE;
32467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual bool IsBookmarkBarAnimating() const OVERRIDE;
32567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual bool IsTabStripEditable() const OVERRIDE;
32636397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose  virtual bool IsToolbarVisible() const OVERRIDE;
32736397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose  virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE;
32836397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose  virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
32967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek                                        Profile* profile) OVERRIDE;
33067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void ShowUpdateChromeDialog() OVERRIDE;
33167d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void ShowBookmarkBubble(const GURL& url,
33267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek                                  bool already_bookmarked) OVERRIDE;
33367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void ShowBookmarkAppBubble(
3342b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek      const WebApplicationInfo& web_app_info,
33599ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie      const std::string& extension_id) OVERRIDE;
3362b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek  virtual void ShowBookmarkPrompt() OVERRIDE;
3372b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek  virtual void ShowTranslateBubble(content::WebContents* contents,
3382b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek                                   TranslateTabHelper::TranslateStep step,
3392b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek                                   TranslateErrors::Type error_type) OVERRIDE;
34036397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose#if defined(ENABLE_ONE_CLICK_SIGNIN)
34136397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose  virtual void ShowOneClickSigninBubble(
34236397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose      OneClickSigninBubbleType type,
3432b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek      const base::string16& email,
3442b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek      const base::string16& error_message,
3452b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek      const StartSyncCallback& start_sync_callback) OVERRIDE;
3462b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek#endif
3472b87ae45e129b941d0a4d221c9d4842385a119bdTed Kremenek  // TODO(beng): Not an override, move somewhere else.
34867d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  void SetDownloadShelfVisible(bool visible);
34967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual bool IsDownloadShelfVisible() const OVERRIDE;
35067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual DownloadShelf* GetDownloadShelf() OVERRIDE;
3519e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  virtual void ConfirmBrowserCloseWithPendingDownloads(
35267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      int download_count,
35367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      Browser::DownloadClosePreventionType dialog_type,
35467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      bool app_modal,
35567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      const base::Callback<void(bool)>& callback) OVERRIDE;
35667d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void UserChangedTheme() OVERRIDE;
35741168eac256fed59ec5406a75fce91c59cd5dd91Ted Kremenek  virtual int GetExtraRenderViewHeight() const OVERRIDE;
35867d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE;
35967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void ShowWebsiteSettings(Profile* profile,
36067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek                                   content::WebContents* web_contents,
36167d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek                                   const GURL& url,
36267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek                                   const content::SSLStatus& ssl) OVERRIDE;
36367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void ShowAppMenu() OVERRIDE;
36467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual bool PreHandleKeyboardEvent(
36567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      const content::NativeWebKeyboardEvent& event,
36667d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      bool* is_keyboard_shortcut) OVERRIDE;
36767d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void HandleKeyboardEvent(
36867d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      const content::NativeWebKeyboardEvent& event) OVERRIDE;
36967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void Cut() OVERRIDE;
37067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void Copy() OVERRIDE;
37199ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  virtual void Paste() OVERRIDE;
37267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual WindowOpenDisposition GetDispositionForPopupBounds(
37367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      const gfx::Rect& bounds) OVERRIDE;
37467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual FindBar* CreateFindBar() OVERRIDE;
37567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual web_modal::WebContentsModalDialogHost*
37636397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose      GetWebContentsModalDialogHost() OVERRIDE;
37736397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose  virtual void ShowAvatarBubble(content::WebContents* web_contents,
37836397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose                                const gfx::Rect& rect) OVERRIDE;
37967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE;
38067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void ShowPasswordGenerationBubble(
38167d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      const gfx::Rect& rect,
38267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      const autofill::PasswordForm& form,
38367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      autofill::PasswordGenerator* password_generator) OVERRIDE;
38467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void OverscrollUpdate(int delta_y) OVERRIDE;
38567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual int GetRenderViewHeightInsetWithDetachedBookmarkBar() OVERRIDE;
38699ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  virtual void ExecuteExtensionCommand(
38767d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      const extensions::Extension* extension,
38867d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      const extensions::Command& command) OVERRIDE;
38967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void ShowPageActionPopup(
39067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      const extensions::Extension* extension) OVERRIDE;
39136397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose  virtual void ShowBrowserActionPopup(
39236397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose      const extensions::Extension* extension) OVERRIDE;
39336397dc6c1bf1513a3bac4eabe9209e5b2295a55Jordan Rose
39467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Overridden from BrowserWindowTesting:
39567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual BookmarkBarView* GetBookmarkBarView() const OVERRIDE;
3969e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  virtual LocationBarView* GetLocationBarView() const OVERRIDE;
3979e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  virtual views::View* GetTabContentsContainerView() const OVERRIDE;
3989e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  virtual ToolbarView* GetToolbarView() const OVERRIDE;
3997caf9b369cba6edaf6eac25121cbc65ee938f14dZhongxing Xu
400993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek  // Overridden from TabStripModelObserver:
401993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek  virtual void TabDetachedAt(content::WebContents* contents,
402993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek                             int index) OVERRIDE;
40399ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  virtual void TabDeactivated(content::WebContents* contents) OVERRIDE;
40499ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  virtual void TabStripEmpty() OVERRIDE;
4059e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek
4061eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // Overridden from ui::AcceleratorProvider:
407993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek  virtual bool GetAcceleratorForCommandId(int command_id,
4089e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek      ui::Accelerator* accelerator) OVERRIDE;
4099e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek
4109e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // Overridden from views::WidgetDelegate:
4119e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  virtual bool CanResize() const OVERRIDE;
4121eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual bool CanMaximize() const OVERRIDE;
41332f2656b90900ac04c4b50e87c16749d0ceb9ef2Jordy Rose  virtual bool CanActivate() const OVERRIDE;
414c8413fd03f73084a5c93028f8b4db619fc388087Ted Kremenek  virtual base::string16 GetWindowTitle() const OVERRIDE;
41532f2656b90900ac04c4b50e87c16749d0ceb9ef2Jordy Rose  virtual base::string16 GetAccessibleWindowTitle() const OVERRIDE;
41632f2656b90900ac04c4b50e87c16749d0ceb9ef2Jordy Rose  virtual views::View* GetInitiallyFocusedView() OVERRIDE;
41732f2656b90900ac04c4b50e87c16749d0ceb9ef2Jordy Rose  virtual bool ShouldShowWindowTitle() const OVERRIDE;
418a43484afda4c4fb4b23a53a2dc91d985d39dc2c4Ted Kremenek  virtual gfx::ImageSkia GetWindowAppIcon() OVERRIDE;
4191eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
4205f7c0add1ea1d8e1d2f920d77fd1a7b6160c2d93Anna Zaks  virtual bool ShouldShowWindowIcon() const OVERRIDE;
4211eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual bool ExecuteWindowsCommand(int command_id) OVERRIDE;
4229e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  virtual std::string GetWindowName() const OVERRIDE;
42367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  virtual void SaveWindowPlacement(const gfx::Rect& bounds,
424993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek                                   ui::WindowShowState show_state) OVERRIDE;
425993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek  virtual bool GetSavedWindowPlacement(
4261eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump      const views::Widget* widget,
42719e1f0ba5cec738ce6cebe3fe0e1edc782206494Ted Kremenek      gfx::Rect* bounds,
42819e1f0ba5cec738ce6cebe3fe0e1edc782206494Ted Kremenek      ui::WindowShowState* show_state) const OVERRIDE;
4291eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual views::View* GetContentsView() OVERRIDE;
430ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu  virtual views::ClientView* CreateClientView(views::Widget* widget) OVERRIDE;
43182bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  virtual void OnWindowBeginUserBoundsChange() OVERRIDE;
43282bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  virtual void OnWidgetMove() OVERRIDE;
43382bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  virtual views::Widget* GetWidget() OVERRIDE;
43482bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  virtual const views::Widget* GetWidget() const OVERRIDE;
43582bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  virtual void GetAccessiblePanes(std::vector<View*>* panes) OVERRIDE;
43682bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek
43782bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  // Overridden from views::WidgetObserver:
4389c378f705405d37f49795d5e915989de774fe11fTed Kremenek  virtual void OnWidgetActivationChanged(views::Widget* widget,
43982bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek                                         bool active) OVERRIDE;
4409c378f705405d37f49795d5e915989de774fe11fTed Kremenek
44182bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  // Overridden from views::ClientView:
4421eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual bool CanClose() OVERRIDE;
44382bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
4441eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual gfx::Size GetMinimumSize() OVERRIDE;
4459c378f705405d37f49795d5e915989de774fe11fTed Kremenek
4469852b5bf94d4934de63da6356c651c61e81f58d9Zhongxing Xu  // InfoBarContainer::Delegate overrides
4479852b5bf94d4934de63da6356c651c61e81f58d9Zhongxing Xu  virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE;
4489852b5bf94d4934de63da6356c651c61e81f58d9Zhongxing Xu  virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE;
449c8413fd03f73084a5c93028f8b4db619fc388087Ted Kremenek  virtual bool DrawInfoBarArrows(int* x) const OVERRIDE;
45032f2656b90900ac04c4b50e87c16749d0ceb9ef2Jordy Rose
45182bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  // gfx::SysColorChangeListener overrides:
45282bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  virtual void OnSysColorChange() OVERRIDE;
4539c378f705405d37f49795d5e915989de774fe11fTed Kremenek
4547ae7ad9951f032d0a33b64c964f7cdcb9cc6f59bTed Kremenek  // Overridden from views::View:
4551eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual const char* GetClassName() const OVERRIDE;
4569c378f705405d37f49795d5e915989de774fe11fTed Kremenek  virtual void Layout() OVERRIDE;
4571eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE;
45882bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  virtual void ViewHierarchyChanged(
45982bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek      const ViewHierarchyChangedDetails& details) OVERRIDE;
46082bd99f4db2454cc6e1b7bfaac6db25cb3444ddcTed Kremenek  virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
4611eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
4621eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump
463993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek  // Overridden from ui::AcceleratorTarget:
464993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek  virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
46599ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie
46699ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  // OmniboxPopupModelObserver overrides
467993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek  virtual void OnOmniboxPopupShownOrHidden() OVERRIDE;
468993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek
4691eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // Testing interface:
470993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek  views::View* GetContentsContainerForTest() { return contents_container_; }
4719697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  views::WebView* GetContentsWebViewForTest() { return contents_web_view_; }
4729697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  views::WebView* GetDevToolsWebViewForTest() { return devtools_web_view_; }
4739697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek
4749697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek private:
4759697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate
4769697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  // interface to keep these two classes decoupled and testable.
4779697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  friend class BrowserViewLayoutDelegateImpl;
4789697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  FRIEND_TEST_ALL_PREFIXES(BrowserViewTest, BrowserView);
4799697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  FRIEND_TEST_ALL_PREFIXES(BrowserViewsAccessibilityTest,
4809697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek                           TestAboutChromeViewAccObj);
4819697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek
4829697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  enum FullscreenMode {
4839697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek    NORMAL_FULLSCREEN,
4849697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek    METRO_SNAP_FULLSCREEN
4859697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  };
4869697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek
48799ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  // Appends to |toolbars| a pointer to each AccessiblePaneView that
48899ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  // can be traversed using F6, in the order they should be traversed.
4899697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  void GetAccessiblePanes(std::vector<views::AccessiblePaneView*>* panes);
4909697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek
4919697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  // Constructs and initializes the child views.
4929697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  void InitViews();
493018220c343c103b7dfaa117a7a474c7a7fd6d068Zhongxing Xu
4941eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // Callback for the loading animation(s) associated with this view.
495018220c343c103b7dfaa117a7a474c7a7fd6d068Zhongxing Xu  void LoadingAnimationCallback();
4966eddeb153415049c7b62de4b45385a759a6906c6Ted Kremenek
497a6b0b96e5376cd9cf182a3e240e0537feed43cdeTed Kremenek  // LoadCompleteListener::Delegate implementation. Creates and initializes the
498a6b0b96e5376cd9cf182a3e240e0537feed43cdeTed Kremenek  // |jumplist_| after the first page load.
499a6b0b96e5376cd9cf182a3e240e0537feed43cdeTed Kremenek  virtual void OnLoadCompleted() OVERRIDE;
500a6b0b96e5376cd9cf182a3e240e0537feed43cdeTed Kremenek
501a6b0b96e5376cd9cf182a3e240e0537feed43cdeTed Kremenek  // Returns the BrowserViewLayout.
5026eddeb153415049c7b62de4b45385a759a6906c6Ted Kremenek  BrowserViewLayout* GetBrowserViewLayout() const;
5031eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump
50449f4e1cbd839da27ff4814b4ea6d85a79f786cbdJohn McCall  // Returns the ContentsLayoutManager.
505018220c343c103b7dfaa117a7a474c7a7fd6d068Zhongxing Xu  ContentsLayoutManager* GetContentsLayoutManager() const;
5061ab55e9bb87d98bff1d42c7a0ee502c64755d9f5Douglas Gregor
50714553abd17d303b0b310b3ab1523eb0d30d8121cTed Kremenek  // Prepare to show the Bookmark Bar for the specified WebContents.
5081eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // Returns true if the Bookmark Bar can be shown (i.e. it's supported for this
509e0d24eb1060a213ec9820dc02c45f26b2d5b348bJordan Rose  // Browser type) and there should be a subsequent re-layout to show it.
510e0d24eb1060a213ec9820dc02c45f26b2d5b348bJordan Rose  // |contents| can be NULL.
511993f1c72913417be7c534ec7a634363cdfc84fa5Ted Kremenek  bool MaybeShowBookmarkBar(content::WebContents* contents);
5129e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek
5139697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  // Moves the bookmark bar view to the specified parent, which may be NULL,
5149e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // |this|, or |top_container_|. Ensures that |top_container_| stays in front
5159e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  // of |bookmark_bar_view_|.
5169e24049bef26b6289cce9ac9b483c5cbb096e3aeTed Kremenek  void SetBookmarkBarParent(views::View* new_parent);
517ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu
518eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // Prepare to show an Info Bar for the specified WebContents. Returns
51999ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  // true if there is an Info Bar to show and one is supported for this Browser
52099ba9e3bd70671f3441fb974895f226a83ce0e66David Blaikie  // type, and there should be a subsequent re-layout to show it.
521eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // |contents| can be NULL.
522eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  bool MaybeShowInfoBar(content::WebContents* contents);
523ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu
524eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // Updates devtools window for given contents. This method will show docked
525eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // devtools window for inspected |web_contents| that has docked devtools
526eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // and hide it for NULL or not inspected |web_contents|. It will also make
527eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // sure devtools window size and position are restored for given tab.
528eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // This method will not update actual DevTools WebContents, if not
529eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // |update_devtools_web_contents|. In this case, manual update is required.
530eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  void UpdateDevToolsForContents(content::WebContents* web_contents,
531ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu                                 bool update_devtools_web_contents);
532eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek
533eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // Updates various optional child Views, e.g. Bookmarks Bar, Info Bar or the
5345fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // Download Shelf in response to a change notification from the specified
535eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // |contents|. |contents| can be NULL. In this case, all optional UI will be
5365fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // removed.
5375fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  void UpdateUIForContents(content::WebContents* contents);
5385fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks
5395fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // Invoked to update the necessary things when our fullscreen state changes
540eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // to |fullscreen|. On Windows this is invoked immediately when we toggle the
541018220c343c103b7dfaa117a7a474c7a7fd6d068Zhongxing Xu  // full screen state. On Linux changing the fullscreen state is async, so we
5425fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // ask the window to change its fullscreen state, then when we get
5435fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // notification that it succeeded this method is invoked.
5445fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // If |url| is not empty, it is the URL of the page that requested fullscreen
5455fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // (via the fullscreen JS API).
5465fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // |bubble_type| determines what should be shown in the fullscreen exit
5475fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // bubble.
5485fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  void ProcessFullscreen(bool fullscreen,
5495fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks                         FullscreenMode mode,
5505fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks                         const GURL& url,
5515fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks                         FullscreenExitBubbleType bubble_type);
5525fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks
553ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu  // Returns whether immmersive fullscreen should replace fullscreen. This
5545fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // should only occur for "browser-fullscreen" for tabbed-typed windows (not
5555fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  // for tab-fullscreen and not for app/popup type windows).
556abd46e13cfd48f2c9bf26d9759edb4366aaa6d5bTed Kremenek  bool ShouldUseImmersiveFullscreenForUrl(const GURL& url) const;
55772e032004b0d2c2c298e8e4f7027f23a21c0cc7dTed Kremenek
558eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // Copy the accelerator table from the app resources into something we can
5599c378f705405d37f49795d5e915989de774fe11fTed Kremenek  // use.
560eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  void LoadAccelerators();
561ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu
562eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // Retrieves the command id for the specified Windows app command.
5635fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0Anna Zaks  int GetCommandIDForAppCommandID(int app_command_id) const;
564abd46e13cfd48f2c9bf26d9759edb4366aaa6d5bTed Kremenek
565eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // Initialize the hung plugin detector.
566ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu  void InitHangMonitor();
567eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek
568eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // Possibly records a user metrics action corresponding to the passed-in
569eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // accelerator.  Only implemented for Chrome OS, where we're interested in
570eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // learning about how frequently the top-row keys are used.
571eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  void UpdateAcceleratorMetrics(const ui::Accelerator& accelerator,
572eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek                                int command_id);
5730a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek
5740a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // Calls |method| which is either RenderFrameHost::Cut, ::Copy, or ::Paste,
5750a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // first trying the content WebContents, then the devtools WebContents, and
5760a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // lastly the Views::Textfield if one is focused.
5770a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  void DoCutCopyPaste(void (content::RenderFrameHost::*method)(),
578eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek                      int command_id);
57967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
58067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Calls |method| which is either RenderFrameHost::Cut, ::Copy, or ::Paste on
581eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // the given WebContents, returning true if it consumed the event.
5821d26f48dc2eea1c07431ca1519d7034a21b9bcffTed Kremenek  bool DoCutCopyPasteForWebContents(
583eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek      content::WebContents* contents,
58467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek      void (content::RenderFrameHost::*method)());
58567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
5861d26f48dc2eea1c07431ca1519d7034a21b9bcffTed Kremenek  // Shows the next app-modal dialog box, if there is one to be shown, or moves
58767d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // an existing showing one to the front.
58867d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  void ActivateAppModalDialog() const;
58967d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek
590018220c343c103b7dfaa117a7a474c7a7fd6d068Zhongxing Xu  // Returns the max top arrow height for infobar.
591eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  int GetMaxTopInfoBarArrowHeight();
592eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek
593eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // Last focused view that issued a tab traversal.
594eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  int last_focused_view_storage_id_;
595eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek
596eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // The BrowserFrame that hosts this view.
59767d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  BrowserFrame* frame_;
5981d26f48dc2eea1c07431ca1519d7034a21b9bcffTed Kremenek
599eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // The Browser object we are associated with.
6009c378f705405d37f49795d5e915989de774fe11fTed Kremenek  scoped_ptr<Browser> browser_;
601eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek
602eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // BrowserView layout (LTR one is pictured here).
603eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  //
604eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // --------------------------------------------------------------------
6051d26f48dc2eea1c07431ca1519d7034a21b9bcffTed Kremenek  // | TopContainerView (top_container_)                                |
60667d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // |  --------------------------------------------------------------  |
607eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // |  | Tabs (tabstrip_)                                           |  |
608eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // |  |------------------------------------------------------------|  |
609eb1c7a04509f5d25c09005a6d46bd8bbb3ca88cbTed Kremenek  // |  | Navigation buttons, address bar, menu (toolbar_)           |  |
610ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu  // |  --------------------------------------------------------------  |
611ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu  // |------------------------------------------------------------------|
6120a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // | All infobars (infobar_container_) [1]                            |
6130a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // |------------------------------------------------------------------|
6140a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // | Bookmarks (bookmark_bar_view_) [1]                               |
6150a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // |------------------------------------------------------------------|
6160a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // | Contents container (contents_container_)                         |
6170a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // |  --------------------------------------------------------------  |
6180a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // |  |  devtools_web_view_                                        |  |
6198ecf59afbab1dbf184dc4c0c47e7213cbd32ba0aJordan Rose  // |  |------------------------------------------------------------|  |
62067d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // |  |  contents_web_view_                                        |  |
6210a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // |  --------------------------------------------------------------  |
62267d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // |------------------------------------------------------------------|
6234240096011a187807058f887eb81df750ffa17feTed Kremenek  // | Active downloads (download_shelf_)                               |
62485d87df66a50a15a1957f7213802000b451a8ec9Ted Kremenek  // --------------------------------------------------------------------
62567d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  //
62667d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // [1] The bookmark bar and info bar are swapped when on the new tab page.
6270a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  //     Additionally when the bookmark bar is detached, contents_container_ is
6288ecf59afbab1dbf184dc4c0c47e7213cbd32ba0aJordan Rose  //     positioned on top of the bar while the tab's contents are placed below
62985d87df66a50a15a1957f7213802000b451a8ec9Ted Kremenek  //     the bar.  This allows the find bar to always align with the top of
6300a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  //     contents_container_ regardless if there's bookmark or info bars.
63185d87df66a50a15a1957f7213802000b451a8ec9Ted Kremenek
6320a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // The view that manages the tab strip, toolbar, and sometimes the bookmark
6334240096011a187807058f887eb81df750ffa17feTed Kremenek  // bar. Stacked top in the view hiearachy so it can be used to slide out
634d02e83a548359df978f40cc1a52ffd78b7ef371bTed Kremenek  // the top views in immersive fullscreen.
6358ecf59afbab1dbf184dc4c0c47e7213cbd32ba0aJordan Rose  TopContainerView* top_container_;
6368ecf59afbab1dbf184dc4c0c47e7213cbd32ba0aJordan Rose
637d02e83a548359df978f40cc1a52ffd78b7ef371bTed Kremenek  // The TabStrip.
63881cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  TabStrip* tabstrip_;
63981cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek
64085d87df66a50a15a1957f7213802000b451a8ec9Ted Kremenek  // The Toolbar containing the navigation buttons, menus and the address bar.
64181cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  ToolbarView* toolbar_;
64285d87df66a50a15a1957f7213802000b451a8ec9Ted Kremenek
64385d87df66a50a15a1957f7213802000b451a8ec9Ted Kremenek  // This button sits next to the tabs on the right hand side and it is used
64485d87df66a50a15a1957f7213802000b451a8ec9Ted Kremenek  // only in windows metro metro mode to allow the user to flip among browser
64585d87df66a50a15a1957f7213802000b451a8ec9Ted Kremenek  // windows.
646e3ce2c10c3f6ae7b26700d758de909deab190d42Ted Kremenek  views::Button* window_switcher_button_;
64781cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek
64881cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  // The Bookmark Bar View for this window. Lazily created. May be NULL for
649e3ce2c10c3f6ae7b26700d758de909deab190d42Ted Kremenek  // non-tabbed browsers like popups. May not be visible.
650e3ce2c10c3f6ae7b26700d758de909deab190d42Ted Kremenek  scoped_ptr<BookmarkBarView> bookmark_bar_view_;
651e3ce2c10c3f6ae7b26700d758de909deab190d42Ted Kremenek
652e3ce2c10c3f6ae7b26700d758de909deab190d42Ted Kremenek  // The do-nothing view which controls the z-order of the find bar widget
65381cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  // relative to views which paint into layers and views with an associated
65481cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  // NativeView.
65581cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  View* find_bar_host_view_;
65681cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek
65781cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  // The download shelf view (view at the bottom of the page).
65881cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  scoped_ptr<DownloadShelfView> download_shelf_;
6599c378f705405d37f49795d5e915989de774fe11fTed Kremenek
66081cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  // The InfoBarContainerView that contains InfoBars for the current tab.
66185d87df66a50a15a1957f7213802000b451a8ec9Ted Kremenek  InfoBarContainerView* infobar_container_;
66281cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek
66381cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  // The view that contains the selected WebContents.
66481cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek  ContentsWebView* contents_web_view_;
66581cef5889027d0f96b24afa7a0bb28d9023474edTed Kremenek
6664240096011a187807058f887eb81df750ffa17feTed Kremenek  // The view that contains devtools window for the selected WebContents.
6674240096011a187807058f887eb81df750ffa17feTed Kremenek  views::WebView* devtools_web_view_;
6680a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek
6699c378f705405d37f49795d5e915989de774fe11fTed Kremenek  // The view managing the devtools and contents positions.
6700a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // Handled by ContentsLayoutManager.
6710a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  views::View* contents_container_;
6720a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek
67367d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // Docked devtools window instance. NULL when current tab is not inspected
67467d1287035767f4f6c8ca0c2bb755990012a44caTed Kremenek  // or is inspected with undocked version of DevToolsWindow.
6750a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  DevToolsWindow* devtools_window_;
6760a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek
6770a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // Tracks and stores the last focused view which is not the
6780a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  // devtools_web_view_ or any of its children. Used to restore focus once
6794240096011a187807058f887eb81df750ffa17feTed Kremenek  // the devtools_web_view_ is hidden.
6804240096011a187807058f887eb81df750ffa17feTed Kremenek  scoped_ptr<views::ExternalFocusTracker> devtools_focus_tracker_;
68124570c4c258545f8310e4bc96503a5668982cf67Ted Kremenek
68224570c4c258545f8310e4bc96503a5668982cf67Ted Kremenek  // The Status information bubble that appears at the bottom of the window.
6830a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0Ted Kremenek  scoped_ptr<StatusBubbleViews> status_bubble_;
684ec13d9206645af07ef7c571405893b8d901de151Zhongxing Xu
685026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  // The permission bubble view is the toolkit-specific implementation of the
686026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  // interface used by the manager to display permissions bubbles.
687026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  scoped_ptr<PermissionBubbleViewViews> permission_bubble_view_;
688026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu
689026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  // A mapping between accelerators and commands.
690e8e86482da4c1872673bbb9c237649229d19793bTed Kremenek  std::map<ui::Accelerator, int> accelerator_table_;
691026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu
692026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  // True if we have already been initialized.
693026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  bool initialized_;
694026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu
6951eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // True when in ProcessFullscreen(). The flag is used to avoid reentrance and
696e8e86482da4c1872673bbb9c237649229d19793bTed Kremenek  // to ignore requests to layout while in ProcessFullscreen() to reduce
6971eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // jankiness.
698026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  bool in_process_fullscreen_;
699026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu
700026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  scoped_ptr<FullscreenExitBubbleViews> fullscreen_bubble_;
701026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu
7029852b5bf94d4934de63da6356c651c61e81f58d9Zhongxing Xu#if defined(OS_WIN)
7039852b5bf94d4934de63da6356c651c61e81f58d9Zhongxing Xu  // This object is used to perform periodic actions in a worker
704c8413fd03f73084a5c93028f8b4db619fc388087Ted Kremenek  // thread. It is currently used to monitor hung plugin windows.
70532f2656b90900ac04c4b50e87c16749d0ceb9ef2Jordy Rose  WorkerThreadTicker ticker_;
706026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu
707026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  // This object is initialized with the frame window HWND. This
708250101353b711a409b075f1bc11070dddec7100bTed Kremenek  // object is also passed as a tick handler with the ticker_ object.
709250101353b711a409b075f1bc11070dddec7100bTed Kremenek  // It is used to periodically monitor for hung plugin windows
710250101353b711a409b075f1bc11070dddec7100bTed Kremenek  HungWindowDetector hung_window_detector_;
7111eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump
7129c378f705405d37f49795d5e915989de774fe11fTed Kremenek  // This object is invoked by hung_window_detector_ when it detects a hung
7131eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // plugin window.
714026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  HungPluginAction hung_plugin_action_;
715026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu
716026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu  // Helper class to listen for completion of first page load.
7171eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  scoped_ptr<LoadCompleteListener> load_complete_listener_;
718026c66395b88a09437319139a43b090093f7e1ddZhongxing Xu
719e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu  // The custom JumpList for Windows 7.
7209697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  scoped_refptr<JumpList> jumplist_;
721e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu#endif
722e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu
723e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu  // The timer used to update frames for the Loading Animation.
724e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu  base::RepeatingTimer<BrowserView> loading_animation_timer_;
725250101353b711a409b075f1bc11070dddec7100bTed Kremenek
7269697934650354bed2e509d8e7e44f21a1fb00f76Ted Kremenek  views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
727e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu
728e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu  // Used to measure the loading spinner animation rate.
729e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu  base::TimeTicks last_animation_time_;
730e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu
731e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu  // If this flag is set then SetFocusToLocationBar() will set focus to the
732e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu  // location bar even if the browser window is not active.
7336613d08a19aa6ce9b6330487f3bfac841d4b8a4dZhongxing Xu  bool force_location_bar_focus_;
7346613d08a19aa6ce9b6330487f3bfac841d4b8a4dZhongxing Xu
7351eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  scoped_ptr<ImmersiveModeController> immersive_mode_controller_;
736018220c343c103b7dfaa117a7a474c7a7fd6d068Zhongxing Xu
737ff6978263439e21d795b0602fabcb38488ef8441Zhongxing Xu  scoped_ptr<ScrollEndEffectController> scroll_end_effect_controller_;
738ff6978263439e21d795b0602fabcb38488ef8441Zhongxing Xu
739e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu  gfx::ScopedSysColorChangeListener color_change_listener_;
740c8413fd03f73084a5c93028f8b4db619fc388087Ted Kremenek
74132f2656b90900ac04c4b50e87c16749d0ceb9ef2Jordy Rose  mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_;
7420a51f1c6cec6032bcf64ce205bc4edfdc3cb3a2fZhongxing Xu
7430a51f1c6cec6032bcf64ce205bc4edfdc3cb3a2fZhongxing Xu  DISALLOW_COPY_AND_ASSIGN(BrowserView);
744e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu};
745e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu
746e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu#endif  // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_
747e9f4e5420895a75dd788e9891921e7781c1823b9Zhongxing Xu