summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-05 21:36:57 +0000
committerfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-05 21:36:57 +0000
commitc2cbeb9dd8aec543d5c6f0fe2aa99c1f8c655351 (patch)
tree6f71cefde95cc33d0f656917a48df2466f8c655a /chrome/browser/views
parent970556302b1ea50d4fc680d3656269cd50f6cf08 (diff)
downloadchromium_src-c2cbeb9dd8aec543d5c6f0fe2aa99c1f8c655351.zip
chromium_src-c2cbeb9dd8aec543d5c6f0fe2aa99c1f8c655351.tar.gz
chromium_src-c2cbeb9dd8aec543d5c6f0fe2aa99c1f8c655351.tar.bz2
Readding UI test I pulled yesterday; hopefully the bots will like it more now. I need to wait for the bookmark bar to become visible so I plumbed in similar code as for the Find box instead of using Sleep's.
Review URL: http://codereview.chromium.org/473 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1809 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc6
-rw-r--r--chrome/browser/views/bookmark_bar_view.h5
-rw-r--r--chrome/browser/views/frame/browser_view.cc14
-rw-r--r--chrome/browser/views/frame/browser_view.h1
-rw-r--r--chrome/browser/views/frame/browser_view2.cc13
-rw-r--r--chrome/browser/views/frame/browser_view2.h1
6 files changed, 36 insertions, 4 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index fb9d579..191aa04 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -265,7 +265,7 @@ class BookmarkButton : public ChromeViews::TextButton {
Profile* profile_;
scoped_ptr<SlideAnimation> show_animation_;
- DISALLOW_EVIL_CONSTRUCTORS(BookmarkButton);
+ DISALLOW_COPY_AND_ASSIGN(BookmarkButton);
};
// DropInfo -------------------------------------------------------------------
@@ -545,7 +545,7 @@ class MenuRunner : public ChromeViews::MenuDelegate,
scoped_ptr<BookmarkBarContextMenuController> context_menu_;
- DISALLOW_EVIL_CONSTRUCTORS(MenuRunner);
+ DISALLOW_COPY_AND_ASSIGN(MenuRunner);
};
// ButtonSeparatorView --------------------------------------------------------
@@ -585,7 +585,7 @@ class ButtonSeparatorView : public ChromeViews::View {
}
private:
- DISALLOW_EVIL_CONSTRUCTORS(ButtonSeparatorView);
+ DISALLOW_COPY_AND_ASSIGN(ButtonSeparatorView);
};
} // namespace
diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h
index d48780c..d9bd48b 100644
--- a/chrome/browser/views/bookmark_bar_view.h
+++ b/chrome/browser/views/bookmark_bar_view.h
@@ -135,6 +135,9 @@ class BookmarkBarView : public ChromeViews::View,
// True if we're supposed to draw the bookmarks bar in the new tab style.
bool IsNewTabPage();
+ // Whether or not we are animating.
+ bool IsAnimating() { return size_animation_->IsAnimating(); }
+
// SlideAnimationDelegate implementation.
void AnimationProgressed(const Animation* animation);
void AnimationEnded(const Animation* animation);
@@ -194,7 +197,7 @@ class BookmarkBarView : public ChromeViews::View,
BookmarkBarView* view_;
BookmarkBarNode* node_;
- DISALLOW_EVIL_CONSTRUCTORS(ShowFolderDropMenuTask);
+ DISALLOW_COPY_AND_ASSIGN(ShowFolderDropMenuTask);
};
// Creates recent bookmark button and when visible button as well as
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index ab02f4c..b35958c 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -188,6 +188,20 @@ void BrowserView::DestroyBrowser() {
frame_->DestroyBrowser();
}
+bool BrowserView::IsBookmarkBarVisible() const {
+ BookmarkBarView* bookmark_bar_view = frame_->GetBookmarkBarView();
+ if (!bookmark_bar_view)
+ return false;
+
+ if (bookmark_bar_view->IsNewTabPage() || bookmark_bar_view->IsAnimating())
+ return true;
+
+ CSize sz;
+ bookmark_bar_view->GetPreferredSize(&sz);
+ // 1 is the minimum in GetPreferredSize for the bookmark bar.
+ return sz.cy > 1;
+}
+
///////////////////////////////////////////////////////////////////////////////
// BrowserView, ChromeViews::ClientView overrides:
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index e8ffc03..5d48fc7 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -69,6 +69,7 @@ class BrowserView : public BrowserWindow,
virtual void ProfileChanged(Profile* profile);
virtual void FocusToolbar();
virtual void DestroyBrowser();
+ virtual bool IsBookmarkBarVisible() const;
/*
// Overridden from ChromeViews::ClientView:
diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc
index db3eedf..64c210d 100644
--- a/chrome/browser/views/frame/browser_view2.cc
+++ b/chrome/browser/views/frame/browser_view2.cc
@@ -440,6 +440,19 @@ void BrowserView2::FocusToolbar() {
void BrowserView2::DestroyBrowser() {
}
+bool BrowserView2::IsBookmarkBarVisible() const {
+ if (!bookmark_bar_view_.get())
+ return false;
+
+ if (bookmark_bar_view_->IsNewTabPage() || bookmark_bar_view_->IsAnimating())
+ return true;
+
+ CSize sz;
+ bookmark_bar_view_->GetPreferredSize(&sz);
+ // 1 is the minimum in GetPreferredSize for the bookmark bar.
+ return sz.cy > 1;
+}
+
///////////////////////////////////////////////////////////////////////////////
// BrowserView2, NotificationObserver implementation:
diff --git a/chrome/browser/views/frame/browser_view2.h b/chrome/browser/views/frame/browser_view2.h
index 40b4a4c..3f6d276 100644
--- a/chrome/browser/views/frame/browser_view2.h
+++ b/chrome/browser/views/frame/browser_view2.h
@@ -162,6 +162,7 @@ class BrowserView2 : public BrowserWindow,
virtual void UpdateToolbar(TabContents* contents, bool should_restore_state);
virtual void FocusToolbar();
virtual void DestroyBrowser();
+ virtual bool IsBookmarkBarVisible() const;
// Overridden from NotificationObserver:
virtual void Observe(NotificationType type,