diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_window.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_frame.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_frame.h | 1 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_frame.h | 1 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 21 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_frame.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_frame.h | 1 |
8 files changed, 23 insertions, 13 deletions
diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h index 2809d2e..5a43bb8 100644 --- a/chrome/browser/browser_window.h +++ b/chrome/browser/browser_window.h @@ -169,7 +169,7 @@ class BrowserWindowTesting { public: #if defined(OS_WIN) // Returns the BookmarkBarView. - virtual BookmarkBarView* GetBookmarkBarView() = 0; + virtual BookmarkBarView* GetBookmarkBarView() const = 0; // Returns the LocationBarView. virtual LocationBarView* GetLocationBarView() const = 0; diff --git a/chrome/browser/views/frame/aero_glass_frame.cc b/chrome/browser/views/frame/aero_glass_frame.cc index 78cda9f..c6e2017 100644 --- a/chrome/browser/views/frame/aero_glass_frame.cc +++ b/chrome/browser/views/frame/aero_glass_frame.cc @@ -84,6 +84,10 @@ views::Window* AeroGlassFrame::GetWindow() { return this; } +const views::Window* AeroGlassFrame::GetWindow() const { + return this; +} + /////////////////////////////////////////////////////////////////////////////// // AeroGlassFrame, views::WidgetWin overrides: diff --git a/chrome/browser/views/frame/aero_glass_frame.h b/chrome/browser/views/frame/aero_glass_frame.h index d6ee7be9..2541467 100644 --- a/chrome/browser/views/frame/aero_glass_frame.h +++ b/chrome/browser/views/frame/aero_glass_frame.h @@ -37,6 +37,7 @@ class AeroGlassFrame : public BrowserFrame, virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; virtual void UpdateThrobber(bool running); virtual views::Window* GetWindow(); + virtual const views::Window* GetWindow() const; protected: // Overridden from views::WidgetWin: diff --git a/chrome/browser/views/frame/browser_frame.h b/chrome/browser/views/frame/browser_frame.h index 28dd275..ee908b5 100644 --- a/chrome/browser/views/frame/browser_frame.h +++ b/chrome/browser/views/frame/browser_frame.h @@ -42,6 +42,7 @@ class BrowserFrame { // Returns the views::Window associated with this frame. virtual views::Window* GetWindow() = 0; + virtual const views::Window* GetWindow() const = 0; enum FrameType { FRAMETYPE_OPAQUE, diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 5111358..5d7059e 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -721,16 +721,7 @@ 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); +BookmarkBarView* BrowserView::GetBookmarkBarView() const { return bookmark_bar_view_.get(); } @@ -1279,7 +1270,15 @@ void BrowserView::LayoutStatusBubble(int top) { bool BrowserView::MaybeShowBookmarkBar(TabContents* contents) { views::View* new_bookmark_bar_view = NULL; if (SupportsWindowFeature(FEATURE_BOOKMARKBAR) && contents) { - new_bookmark_bar_view = GetBookmarkBarView(); + if (!bookmark_bar_view_.get()) { + bookmark_bar_view_.reset(new BookmarkBarView(contents->profile(), + browser_.get())); + bookmark_bar_view_->SetParentOwned(false); + } else { + bookmark_bar_view_->SetProfile(contents->profile()); + } + bookmark_bar_view_->SetPageNavigator(contents); + new_bookmark_bar_view = bookmark_bar_view_.get(); if (!show_bookmark_bar_pref_.GetValue() && new_bookmark_bar_view->GetPreferredSize().height() == 0) { new_bookmark_bar_view = NULL; diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index ba247c9..c8cce70 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -196,7 +196,7 @@ class BrowserView : public BrowserWindow, void* parent_window); // Overridden from BrowserWindowTesting: - virtual BookmarkBarView* GetBookmarkBarView(); + virtual BookmarkBarView* GetBookmarkBarView() const; virtual LocationBarView* GetLocationBarView() const; // Overridden from NotificationObserver: diff --git a/chrome/browser/views/frame/opaque_frame.cc b/chrome/browser/views/frame/opaque_frame.cc index 9a7f356..5895418 100644 --- a/chrome/browser/views/frame/opaque_frame.cc +++ b/chrome/browser/views/frame/opaque_frame.cc @@ -58,6 +58,10 @@ views::Window* OpaqueFrame::GetWindow() { return this; } +const views::Window* OpaqueFrame::GetWindow() const { + return this; +} + /////////////////////////////////////////////////////////////////////////////// // OpaqueFrame, views::CustomFrameWindow overrides: diff --git a/chrome/browser/views/frame/opaque_frame.h b/chrome/browser/views/frame/opaque_frame.h index e5d2f552..8a02595 100644 --- a/chrome/browser/views/frame/opaque_frame.h +++ b/chrome/browser/views/frame/opaque_frame.h @@ -39,6 +39,7 @@ class OpaqueFrame : public BrowserFrame, virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; virtual void UpdateThrobber(bool running); virtual views::Window* GetWindow(); + virtual const views::Window* GetWindow() const; // Overridden from views::CustomFrameWindow: virtual void UpdateWindowIcon(); |