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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 7003039: ui/base/models: Add empty() accessor to TreeNode class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 if (!theme_provider) 1614 if (!theme_provider)
1615 return; 1615 return;
1616 SkColor text_color = 1616 SkColor text_color =
1617 theme_provider->GetColor(ThemeService::COLOR_BOOKMARK_TEXT); 1617 theme_provider->GetColor(ThemeService::COLOR_BOOKMARK_TEXT);
1618 for (int i = 0; i < GetBookmarkButtonCount(); ++i) 1618 for (int i = 0; i < GetBookmarkButtonCount(); ++i)
1619 GetBookmarkButton(i)->SetEnabledColor(text_color); 1619 GetBookmarkButton(i)->SetEnabledColor(text_color);
1620 other_bookmarked_button()->SetEnabledColor(text_color); 1620 other_bookmarked_button()->SetEnabledColor(text_color);
1621 } 1621 }
1622 1622
1623 void BookmarkBarView::UpdateOtherBookmarksVisibility() { 1623 void BookmarkBarView::UpdateOtherBookmarksVisibility() {
1624 bool has_other_children = model_->other_node()->child_count() > 0; 1624 bool has_other_children = !model_->other_node()->empty();
1625 if (has_other_children == other_bookmarked_button_->IsVisible()) 1625 if (has_other_children == other_bookmarked_button_->IsVisible())
1626 return; 1626 return;
1627 other_bookmarked_button_->SetVisible(has_other_children); 1627 other_bookmarked_button_->SetVisible(has_other_children);
1628 bookmarks_separator_view_->SetVisible(has_other_children); 1628 bookmarks_separator_view_->SetVisible(has_other_children);
1629 Layout(); 1629 Layout();
1630 SchedulePaint(); 1630 SchedulePaint();
1631 } 1631 }
1632 1632
1633 gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) { 1633 gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) {
1634 gfx::Size prefsize; 1634 gfx::Size prefsize;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 (1 - size_animation_->GetCurrentValue()))); 1773 (1 - size_animation_->GetCurrentValue())));
1774 } else { 1774 } else {
1775 prefsize.set_height( 1775 prefsize.set_height(
1776 static_cast<int>( 1776 static_cast<int>(
1777 browser_defaults::kBookmarkBarHeight * 1777 browser_defaults::kBookmarkBarHeight *
1778 size_animation_->GetCurrentValue())); 1778 size_animation_->GetCurrentValue()));
1779 } 1779 }
1780 } 1780 }
1781 return prefsize; 1781 return prefsize;
1782 } 1782 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698