From f0ea49bb8d3280a52121666d14cc01ae1e0991e5 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Tue, 17 Aug 2010 17:35:00 +0000 Subject: Misc. clean up: Rewrap, simplify. Refactored two separate files' calls of TabStrip::SetBackgroundOffset() into a single call in a different place. BUG=none TEST=none Review URL: http://codereview.chromium.org/3107012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56377 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/bookmark_bar_view.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'chrome/browser/views/bookmark_bar_view.cc') diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index 2ea1c66..67a4078 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -62,7 +62,7 @@ using views::View; // How much we want the bookmark bar to overlap the toolbar when in its // 'always shown' mode. -static const double kToolbarOverlap = 4.0; +static const int kToolbarOverlap = 4; // Margins around the content. static const int kTopMargin = 1; @@ -395,10 +395,7 @@ BookmarkBarView::BookmarkBarView(Profile* profile, Browser* browser) Init(); SetProfile(profile); - if (IsAlwaysShown()) - size_animation_->Reset(1); - else - size_animation_->Reset(0); + size_animation_->Reset(IsAlwaysShown() ? 1 : 0); } BookmarkBarView::~BookmarkBarView() { @@ -753,8 +750,10 @@ bool BookmarkBarView::OnNewTabPage() const { } int BookmarkBarView::GetToolbarOverlap(bool return_max) { - return static_cast(kToolbarOverlap * - (return_max ? 1.0 : size_animation_->GetCurrentValue())); + if (return_max) + return kToolbarOverlap; + return static_cast(static_cast(kToolbarOverlap) * + size_animation_->GetCurrentValue()); } void BookmarkBarView::AnimationProgressed(const Animation* animation) { -- cgit v1.1