| 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 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 if (!theme_provider) | 1599 if (!theme_provider) |
| 1600 return; | 1600 return; |
| 1601 SkColor text_color = | 1601 SkColor text_color = |
| 1602 theme_provider->GetColor(ThemeService::COLOR_BOOKMARK_TEXT); | 1602 theme_provider->GetColor(ThemeService::COLOR_BOOKMARK_TEXT); |
| 1603 for (int i = 0; i < GetBookmarkButtonCount(); ++i) | 1603 for (int i = 0; i < GetBookmarkButtonCount(); ++i) |
| 1604 GetBookmarkButton(i)->SetEnabledColor(text_color); | 1604 GetBookmarkButton(i)->SetEnabledColor(text_color); |
| 1605 other_bookmarked_button()->SetEnabledColor(text_color); | 1605 other_bookmarked_button()->SetEnabledColor(text_color); |
| 1606 } | 1606 } |
| 1607 | 1607 |
| 1608 void BookmarkBarView::UpdateOtherBookmarksVisibility() { | 1608 void BookmarkBarView::UpdateOtherBookmarksVisibility() { |
| 1609 bool has_other_children = model_->other_node()->child_count() > 0; | 1609 bool has_other_children = !model_->other_node()->empty(); |
| 1610 if (has_other_children == other_bookmarked_button_->IsVisible()) | 1610 if (has_other_children == other_bookmarked_button_->IsVisible()) |
| 1611 return; | 1611 return; |
| 1612 other_bookmarked_button_->SetVisible(has_other_children); | 1612 other_bookmarked_button_->SetVisible(has_other_children); |
| 1613 bookmarks_separator_view_->SetVisible(has_other_children); | 1613 bookmarks_separator_view_->SetVisible(has_other_children); |
| 1614 Layout(); | 1614 Layout(); |
| 1615 SchedulePaint(); | 1615 SchedulePaint(); |
| 1616 } | 1616 } |
| 1617 | 1617 |
| 1618 gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) { | 1618 gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) { |
| 1619 gfx::Size prefsize; | 1619 gfx::Size prefsize; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 (1 - size_animation_->GetCurrentValue()))); | 1758 (1 - size_animation_->GetCurrentValue()))); |
| 1759 } else { | 1759 } else { |
| 1760 prefsize.set_height( | 1760 prefsize.set_height( |
| 1761 static_cast<int>( | 1761 static_cast<int>( |
| 1762 browser_defaults::kBookmarkBarHeight * | 1762 browser_defaults::kBookmarkBarHeight * |
| 1763 size_animation_->GetCurrentValue())); | 1763 size_animation_->GetCurrentValue())); |
| 1764 } | 1764 } |
| 1765 } | 1765 } |
| 1766 return prefsize; | 1766 return prefsize; |
| 1767 } | 1767 } |
| OLD | NEW |