Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 11365075: alternate ntp: tweaks and fixes for bookmark bar in ntp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/search/search_ui.cc ('k') | chrome/browser/ui/views/detachable_toolbar_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 2811a56faaab713c70ef14ee5f0b03d6b6ce203c..2a8047595c8ab2fb1bb189984270b00296c2bc7c 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -134,6 +134,11 @@ static const int kInstructionsPadding = 6;
// Tag for the 'Other bookmarks' button.
static const int kOtherFolderButtonTag = 1;
+// TODO(kuan): change chrome::kNTPBookmarkBarHeight to this new height when
+// search_ntp replaces ntp4; for now, while both versions exist, this new height
+// is only needed locally.
+static const int kSearchNewtabBookmarkBarHeight = 48;
+
namespace {
// BookmarkButton -------------------------------------------------------------
@@ -1659,7 +1664,8 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) {
// Next, layout out the buttons. Any buttons that are placed beyond the
// visible region and made invisible.
- if (GetBookmarkButtonCount() == 0 && model_ && model_->IsLoaded()) {
+ if (GetBookmarkButtonCount() == 0 && model_ && model_->IsLoaded() &&
+ !browser_->search_model()->mode().is_ntp()) {
gfx::Size pref = instructions_->GetPreferredSize();
if (!compute_bounds_only) {
instructions_->SetBounds(
@@ -1729,12 +1735,14 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) {
x += kRightMargin;
prefsize.set_width(x);
if (IsDetached()) {
+ int ntp_bookmark_bar_height = browser_->search_model()->mode().is_ntp() ?
+ kSearchNewtabBookmarkBarHeight : chrome::kNTPBookmarkBarHeight;
x += static_cast<int>(
kNewtabHorizontalPadding * (1 - size_animation_->GetCurrentValue()));
prefsize.set_height(
browser_defaults::kBookmarkBarHeight +
static_cast<int>(
- (chrome::kNTPBookmarkBarHeight -
+ (ntp_bookmark_bar_height -
browser_defaults::kBookmarkBarHeight) *
(1 - size_animation_->GetCurrentValue())));
} else {
« no previous file with comments | « chrome/browser/ui/search/search_ui.cc ('k') | chrome/browser/ui/views/detachable_toolbar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698