diff options
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.cc | 5 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 20 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 7 |
3 files changed, 9 insertions, 23 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index 40f603e..400b7ab 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -871,11 +871,6 @@ void BookmarkBarView::DidChangeBounds(const gfx::Rect& previous, void BookmarkBarView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { - // See http://code.google.com/p/chromium/issues/detail?id=7857 . It seems - // as though the bookmark bar is getting unintentionally removed. - DCHECK(testing_ || child != this || is_add || - static_cast<BrowserView*>(parent)->is_removing_bookmark_bar()); - if (is_add && child == this && height() > 0) { // We only layout while parented. When we become parented, if our bounds // haven't changed, DidChangeBounds won't get invoked and we won't layout. diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 0d9e081..12a057c 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -204,8 +204,7 @@ BrowserView::BrowserView(Browser* browser) personalization_enabled_(false), personalization_(NULL), #endif - forwarding_to_tab_strip_(false), - is_removing_bookmark_bar_(false) { + forwarding_to_tab_strip_(false) { InitClass(); browser_->tabstrip_model()->AddObserver(this); } @@ -708,8 +707,8 @@ void BrowserView::DestroyBrowser() { bool BrowserView::IsBookmarkBarVisible() const { return SupportsWindowFeature(FEATURE_BOOKMARKBAR) && - bookmark_bar_view_.get() && - (bookmark_bar_view_->GetPreferredSize().height() != 0); + active_bookmark_bar_ && + (active_bookmark_bar_->GetPreferredSize().height() != 0); } gfx::Rect BrowserView::GetRootWindowResizerRect() const { @@ -1361,7 +1360,7 @@ int BrowserView::LayoutToolbar(int top) { int BrowserView::LayoutBookmarkAndInfoBars(int top) { find_bar_y_ = top + y() - 1; - if (bookmark_bar_view_.get()) { + if (active_bookmark_bar_) { // If we're showing the Bookmark bar in detached style, then we need to show // any Info bar _above_ the Bookmark bar, since the Bookmark bar is styled // to look like it's part of the page. @@ -1375,7 +1374,7 @@ int BrowserView::LayoutBookmarkAndInfoBars(int top) { } int BrowserView::LayoutBookmarkBar(int top) { - DCHECK(bookmark_bar_view_.get()); + DCHECK(active_bookmark_bar_); bool visible = IsBookmarkBarVisible(); int height, y = top; if (visible) { @@ -1429,9 +1428,8 @@ void BrowserView::LayoutStatusBubble(int top) { bool BrowserView::MaybeShowBookmarkBar(TabContents* contents) { views::View* new_bookmark_bar_view = NULL; - views::View* old_bookmark_bar_view = bookmark_bar_view_.get(); if (SupportsWindowFeature(FEATURE_BOOKMARKBAR) && contents) { - if (!old_bookmark_bar_view) { + if (!bookmark_bar_view_.get()) { bookmark_bar_view_.reset(new BookmarkBarView(contents->profile(), browser_.get())); bookmark_bar_view_->SetParentOwned(false); @@ -1441,11 +1439,7 @@ bool BrowserView::MaybeShowBookmarkBar(TabContents* contents) { bookmark_bar_view_->SetPageNavigator(contents); new_bookmark_bar_view = bookmark_bar_view_.get(); } - is_removing_bookmark_bar_ = true; - bool result = UpdateChildViewAndLayout(new_bookmark_bar_view, - &old_bookmark_bar_view); - is_removing_bookmark_bar_ = false; - return result; + return UpdateChildViewAndLayout(new_bookmark_bar_view, &active_bookmark_bar_); } bool BrowserView::MaybeShowInfoBar(TabContents* contents) { diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index 592e264..ad60baf 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -267,8 +267,6 @@ class BrowserView : public BrowserWindow, } #endif - bool is_removing_bookmark_bar() const { return is_removing_bookmark_bar_; } - protected: // Overridden from views::View: virtual void Layout(); @@ -385,6 +383,8 @@ class BrowserView : public BrowserWindow, scoped_ptr<Browser> browser_; // Tool/Info bars that we are currently showing. Used for layout. + // active_bookmark_bar_ is either NULL, if the bookmark bar isn't showing, + // or is bookmark_bar_view_ if the bookmark bar is showing. views::View* active_bookmark_bar_; views::View* active_download_shelf_; @@ -472,9 +472,6 @@ class BrowserView : public BrowserWindow, bool personalization_enabled_; #endif - // For debugging 7857. - bool is_removing_bookmark_bar_; - DISALLOW_COPY_AND_ASSIGN(BrowserView); }; |