summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 01:34:52 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 01:34:52 +0000
commit0ba1f530cf1dfac50ddb7d3b9ef34f2a753947c4 (patch)
tree7157570d422627b8471e4fe075e82cb43a8fdc9a /chrome/browser/views
parent26c030c76f80811a71243e192c0c1631b62105b8 (diff)
downloadchromium_src-0ba1f530cf1dfac50ddb7d3b9ef34f2a753947c4.zip
chromium_src-0ba1f530cf1dfac50ddb7d3b9ef34f2a753947c4.tar.gz
chromium_src-0ba1f530cf1dfac50ddb7d3b9ef34f2a753947c4.tar.bz2
Move automation specific accessors to their own interface to make their purpose clear, and make porting easier.
Review URL: http://codereview.chromium.org/18481 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/frame/browser_view.cc33
-rw-r--r--chrome/browser/views/frame/browser_view.h6
2 files changed, 25 insertions, 14 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 8214a14..da7adae 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -419,6 +419,10 @@ void* BrowserView::GetNativeHandle() {
return GetWidget()->GetHWND();
}
+BrowserWindowTesting* BrowserView::GetBrowserWindowTesting() {
+ return this;
+}
+
TabStrip* BrowserView::GetTabStrip() const {
return tabstrip_;
}
@@ -485,19 +489,6 @@ GoButton* BrowserView::GetGoButton() const {
return toolbar_->GetGoButton();
}
-BookmarkBarView* BrowserView::GetBookmarkBarView() {
- TabContents* current_tab = browser_->GetSelectedTabContents();
- if (!bookmark_bar_view_.get()) {
- bookmark_bar_view_.reset(new BookmarkBarView(current_tab->profile(),
- browser_.get()));
- bookmark_bar_view_->SetParentOwned(false);
- } else {
- bookmark_bar_view_->SetProfile(current_tab->profile());
- }
- bookmark_bar_view_->SetPageNavigator(current_tab);
- return bookmark_bar_view_.get();
-}
-
BrowserView* BrowserView::GetBrowserView() const {
return NULL;
}
@@ -621,6 +612,22 @@ void BrowserView::ShowHTMLDialog(HtmlDialogContentsDelegate* delegate,
}
///////////////////////////////////////////////////////////////////////////////
+// BrowserView, BrowserWindowTesting implementation:
+
+BookmarkBarView* BrowserView::GetBookmarkBarView() {
+ TabContents* current_tab = browser_->GetSelectedTabContents();
+ if (!bookmark_bar_view_.get()) {
+ bookmark_bar_view_.reset(new BookmarkBarView(current_tab->profile(),
+ browser_.get()));
+ bookmark_bar_view_->SetParentOwned(false);
+ } else {
+ bookmark_bar_view_->SetProfile(current_tab->profile());
+ }
+ bookmark_bar_view_->SetPageNavigator(current_tab);
+ return bookmark_bar_view_.get();
+}
+
+///////////////////////////////////////////////////////////////////////////////
// BrowserView, NotificationObserver implementation:
void BrowserView::Observe(NotificationType type,
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index 172a1db..d2df248 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -34,6 +34,7 @@ class TabContentsContainerView;
// including the TabStrip, toolbars, download shelves, the content area etc.
//
class BrowserView : public BrowserWindow,
+ public BrowserWindowTesting,
public NotificationObserver,
public TabStripModelObserver,
public views::WindowDelegate,
@@ -153,6 +154,7 @@ class BrowserView : public BrowserWindow,
virtual void Activate();
virtual void FlashFrame();
virtual void* GetNativeHandle();
+ virtual BrowserWindowTesting* GetBrowserWindowTesting();
virtual TabStrip* GetTabStrip() const;
virtual StatusBubble* GetStatusBubble();
virtual void SelectedTabToolbarSizeChanged(bool is_animating);
@@ -163,7 +165,6 @@ class BrowserView : public BrowserWindow,
virtual ToolbarStarToggle* GetStarButton() const;
virtual LocationBarView* GetLocationBarView() const;
virtual GoButton* GetGoButton() const;
- virtual BookmarkBarView* GetBookmarkBarView();
virtual BrowserView* GetBrowserView() const;
virtual void UpdateToolbar(TabContents* contents, bool should_restore_state);
virtual void FocusToolbar();
@@ -180,6 +181,9 @@ class BrowserView : public BrowserWindow,
virtual void ShowHTMLDialog(HtmlDialogContentsDelegate* delegate,
void* parent_window);
+ // Overridden from BrowserWindowTesting:
+ virtual BookmarkBarView* GetBookmarkBarView();
+
// Overridden from NotificationObserver:
virtual void Observe(NotificationType type,
const NotificationSource& source,