summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 04:12:23 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 04:12:23 +0000
commit0dbb1ebc5db4d16057884de523d8af80eaf017db (patch)
tree549c8e9bc4ae27a9f88741db0dc17271bc38dc1d
parent3e710bc9772b51e620cf161197d94b356f297db9 (diff)
downloadchromium_src-0dbb1ebc5db4d16057884de523d8af80eaf017db.zip
chromium_src-0dbb1ebc5db4d16057884de523d8af80eaf017db.tar.gz
chromium_src-0dbb1ebc5db4d16057884de523d8af80eaf017db.tar.bz2
Adds some debugging code in hopes of figuring out who is removing the
bookmark bar. BUG=7857 TEST=none Review URL: http://codereview.chromium.org/28100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10325 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc9
-rw-r--r--chrome/browser/views/frame/browser_view.cc10
-rw-r--r--chrome/browser/views/frame/browser_view.h5
3 files changed, 20 insertions, 4 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index 6efe139..4e11edd 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -24,6 +24,7 @@
#include "chrome/browser/view_ids.h"
#include "chrome/browser/views/bookmark_editor_view.h"
#include "chrome/browser/views/event_utils.h"
+#include "chrome/browser/views/frame/browser_view.h"
#include "chrome/browser/views/input_window.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/favicon_size.h"
@@ -868,7 +869,13 @@ void BookmarkBarView::DidChangeBounds(const gfx::Rect& previous,
}
void BookmarkBarView::ViewHierarchyChanged(bool is_add,
- View* parent, View* child) {
+ 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(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 be0020f..7836e7f 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -195,7 +195,8 @@ BrowserView::BrowserView(Browser* browser)
personalization_enabled_(false),
personalization_(NULL),
#endif
- forwarding_to_tab_strip_(false) {
+ forwarding_to_tab_strip_(false),
+ is_removing_bookmark_bar_(false) {
InitClass();
browser_->tabstrip_model()->AddObserver(this);
}
@@ -1423,8 +1424,11 @@ bool BrowserView::MaybeShowBookmarkBar(TabContents* contents) {
bookmark_bar_view_->SetPageNavigator(contents);
new_bookmark_bar_view = bookmark_bar_view_.get();
}
- return UpdateChildViewAndLayout(new_bookmark_bar_view,
- &old_bookmark_bar_view);
+ is_removing_bookmark_bar_ = true;
+ bool result = UpdateChildViewAndLayout(new_bookmark_bar_view,
+ &old_bookmark_bar_view);
+ is_removing_bookmark_bar_ = false;
+ return result;
}
bool BrowserView::MaybeShowInfoBar(TabContents* contents) {
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index c228246..27caa68 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -263,6 +263,8 @@ class BrowserView : public BrowserWindow,
}
#endif
+ bool is_removing_bookmark_bar() const { return is_removing_bookmark_bar_; }
+
protected:
// Overridden from views::View:
virtual void Layout();
@@ -461,6 +463,9 @@ class BrowserView : public BrowserWindow,
bool personalization_enabled_;
#endif
+ // For debugging 7857.
+ bool is_removing_bookmark_bar_;
+
DISALLOW_COPY_AND_ASSIGN(BrowserView);
};