views: Cleanup BrowserView function order and variable names

Motivated by issues I had working in BrowserView and BrowserViewLayout:
* Remove unnecessary virtual keyword and protected section, as this class
  has no subclasses.
* Grouped overridden methods together.
* Fixed function order in .cc file.
* Renamed contents_container_ to contents_web_view_, as it is a WebView
* Renamed contents_ to contents_container_, as it is a ContentsContainer

BUG=232971
TEST=compiles, existing browser tests

Review URL: https://codereview.chromium.org/14205026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194999 0039d316-1c4b-4281-b951-d872f2087c98
parent 727e2448
...@@ -172,15 +172,16 @@ class BrowserView : public BrowserWindow, ...@@ -172,15 +172,16 @@ class BrowserView : public BrowserWindow,
// incognito. // incognito.
bool IsOffTheRecord() const; bool IsOffTheRecord() const;
// Returns the resource ID to use for the OTR icon, which depends on
// which layout is being shown and whether we are full-screen.
int GetOTRIconResourceID() const;
// Returns true if the profile associated with this Browser window is // Returns true if the profile associated with this Browser window is
// a guest session. // a guest session.
bool IsGuestSession() const; bool IsGuestSession() const;
// Returns true if the non-client view should render an avatar icon. // Returns true if the non-client view should render an avatar icon.
virtual bool ShouldShowAvatar() const; bool ShouldShowAvatar() const;
// Handle the specified |accelerator| being pressed.
virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
// Provides the containing frame with the accelerator for the specified // Provides the containing frame with the accelerator for the specified
// command id. This can be used to provide menu item shortcut hints etc. // command id. This can be used to provide menu item shortcut hints etc.
...@@ -424,10 +425,6 @@ class BrowserView : public BrowserWindow, ...@@ -424,10 +425,6 @@ class BrowserView : public BrowserWindow,
// gfx::SysColorChangeListener overrides: // gfx::SysColorChangeListener overrides:
virtual void OnSysColorChange() OVERRIDE; virtual void OnSysColorChange() OVERRIDE;
// Returns the resource ID to use for the OTR icon, which depends on
// which layout is being shown and whether we are full-screen.
int GetOTRIconResourceID() const;
// Overridden from views::View: // Overridden from views::View:
virtual std::string GetClassName() const OVERRIDE; virtual std::string GetClassName() const OVERRIDE;
virtual void Layout() OVERRIDE; virtual void Layout() OVERRIDE;
...@@ -438,26 +435,15 @@ class BrowserView : public BrowserWindow, ...@@ -438,26 +435,15 @@ class BrowserView : public BrowserWindow,
virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
views::SingleSplitView* GetContentsSplitForTest() { return contents_split_; } // Overridden from ui::AcceleratorTarget:
// TODO(jamescook): Rename |contents_| and |contents_container_|. virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
ContentsContainer* GetContentsContainerForTest() { return contents_; }
views::WebView* GetContentsWebViewForTest() { return contents_container_; }
protected:
// Appends to |toolbars| a pointer to each AccessiblePaneView that
// can be traversed using F6, in the order they should be traversed.
// Abstracted here so that it can be extended for Chrome OS.
void GetAccessiblePanes(std::vector<views::AccessiblePaneView*>* panes);
// Browser window related initializations.
void Init();
// Callback for the loading animation(s) associated with this view.
void LoadingAnimationCallback();
// LoadCompleteListener::Delegate implementation. Creates and initializes the // Testing interface:
// |jumplist_| after the first page load. views::SingleSplitView* GetContentsSplitForTest() { return contents_split_; }
virtual void OnLoadCompleted() OVERRIDE; ContentsContainer* GetContentsContainerForTest() {
return contents_container_;
}
views::WebView* GetContentsWebViewForTest() { return contents_web_view_; }
private: private:
friend class BrowserViewLayout; friend class BrowserViewLayout;
...@@ -482,6 +468,20 @@ class BrowserView : public BrowserWindow, ...@@ -482,6 +468,20 @@ class BrowserView : public BrowserWindow,
FullscreenExitBubbleType bubble_type; FullscreenExitBubbleType bubble_type;
}; };
// Appends to |toolbars| a pointer to each AccessiblePaneView that
// can be traversed using F6, in the order they should be traversed.
void GetAccessiblePanes(std::vector<views::AccessiblePaneView*>* panes);
// Browser window related initializations.
void Init();
// Callback for the loading animation(s) associated with this view.
void LoadingAnimationCallback();
// LoadCompleteListener::Delegate implementation. Creates and initializes the
// |jumplist_| after the first page load.
virtual void OnLoadCompleted() OVERRIDE;
// Returns the BrowserViewLayout. // Returns the BrowserViewLayout.
BrowserViewLayout* GetBrowserViewLayout() const; BrowserViewLayout* GetBrowserViewLayout() const;
...@@ -609,10 +609,10 @@ class BrowserView : public BrowserWindow, ...@@ -609,10 +609,10 @@ class BrowserView : public BrowserWindow,
// |------------------------------------------------------------------| // |------------------------------------------------------------------|
// | Debugger splitter (contents_split_) | // | Debugger splitter (contents_split_) |
// | -------------------------------------------------------------- | // | -------------------------------------------------------------- |
// | | Page content (contents_) | | // | | Page content (contents_container_) | |
// | | -------------------------------------------------------- | | // | | -------------------------------------------------------- | |
// | | | contents_container_ and/or | | | // | | | contents_web_view_ and/or | | |
// | | | overlay_controller_->overlay_container_ | | | // | | | overlay_controller_->overlay_ | | |
// | | | | | | // | | | | | |
// | | | | | | // | | | | | |
// | | -------------------------------------------------------- | | // | | -------------------------------------------------------- | |
...@@ -626,10 +626,9 @@ class BrowserView : public BrowserWindow, ...@@ -626,10 +626,9 @@ class BrowserView : public BrowserWindow,
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// //
// [1] The bookmark bar and info bar are swapped when on the new tab page. // [1] The bookmark bar and info bar are swapped when on the new tab page.
// Additionally contents_ is positioned on top of the bookmark bar when // Additionally contents_container_ is positioned on top of the bookmark
// the bookmark bar is detached. This is done to allow the // bar when the bookmark bar is detached. This is done to allow the
// overlay_controller_->overlay_container_ to appear over the bookmark // overlay_controller_->overlay_ to appear over the bookmark bar.
// bar.
// The view that manages the tab strip, toolbar, and sometimes the bookmark // The view that manages the tab strip, toolbar, and sometimes the bookmark
// bar. Stacked in the top of the view hiearachy so it can be used to // bar. Stacked in the top of the view hiearachy so it can be used to
...@@ -658,16 +657,14 @@ class BrowserView : public BrowserWindow, ...@@ -658,16 +657,14 @@ class BrowserView : public BrowserWindow,
InfoBarContainerView* infobar_container_; InfoBarContainerView* infobar_container_;
// The view that contains the selected WebContents. // The view that contains the selected WebContents.
// TODO(jamescook): Rename this to |contents_web_view_| in order to views::WebView* contents_web_view_;
// reduce confusion with ContentsContainer |contents_| below.
views::WebView* contents_container_;
// The view that contains devtools window for the selected WebContents. // The view that contains devtools window for the selected WebContents.
views::WebView* devtools_container_; views::WebView* devtools_container_;
// The view managing both the contents_container_ and // The view managing both the |contents_web_view_| and
// overlay_controller_->overlay_container_. // |overlay_controller_->overlay_|.
ContentsContainer* contents_; ContentsContainer* contents_container_;
// Split view containing the contents container and devtools container. // Split view containing the contents container and devtools container.
views::SingleSplitView* contents_split_; views::SingleSplitView* contents_split_;
......
...@@ -288,7 +288,7 @@ void BrowserViewLayout::ViewAdded(views::View* host, views::View* view) { ...@@ -288,7 +288,7 @@ void BrowserViewLayout::ViewAdded(views::View* host, views::View* view) {
// We're installed as the LayoutManager before BrowserView creates the // We're installed as the LayoutManager before BrowserView creates the
// contents, so we have to set contents_container_ here rather than in // contents, so we have to set contents_container_ here rather than in
// Installed. // Installed.
contents_container_ = browser_view_->contents_; contents_container_ = browser_view_->contents_container_;
break; break;
} }
case VIEW_ID_DOWNLOAD_SHELF: case VIEW_ID_DOWNLOAD_SHELF:
...@@ -307,7 +307,7 @@ void BrowserViewLayout::Layout(views::View* host) { ...@@ -307,7 +307,7 @@ void BrowserViewLayout::Layout(views::View* host) {
// contents to continue to display from that origin. If suggestions // contents to continue to display from that origin. If suggestions
// completely obscure the tab's contents, there's no need to modify the // completely obscure the tab's contents, there's no need to modify the
// content origin. // content origin.
views::WebView* contents = browser_view_->contents_container_; views::WebView* contents = browser_view_->contents_web_view_;
int overlay_height = contents_container_->overlay_height(); int overlay_height = contents_container_->overlay_height();
gfx::Point old_contents_origin; gfx::Point old_contents_origin;
if (overlay_height > 0 && !contents_container_->IsOverlayFullHeight()) { if (overlay_height > 0 && !contents_container_->IsOverlayFullHeight()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment