OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |