| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1986 if (parent == bbn) | 1986 if (parent == bbn) |
| 1987 break; | 1987 break; |
| 1988 parent_on_bb = parent; | 1988 parent_on_bb = parent; |
| 1989 } | 1989 } |
| 1990 if (parent_on_bb) { | 1990 if (parent_on_bb) { |
| 1991 int index = bbn->GetIndexOf(parent_on_bb); | 1991 int index = bbn->GetIndexOf(parent_on_bb); |
| 1992 if (index >= GetFirstHiddenNodeIndex()) { | 1992 if (index >= GetFirstHiddenNodeIndex()) { |
| 1993 // Node is hidden, animate the overflow button. | 1993 // Node is hidden, animate the overflow button. |
| 1994 throbbing_view_ = overflow_button_; | 1994 throbbing_view_ = overflow_button_; |
| 1995 } else if (!overflow_only) { | 1995 } else if (!overflow_only) { |
| 1996 throbbing_view_ = static_cast<CustomButton*>(child_at(index)); | 1996 // Regular BookmarkButtons do not have a throb animation, and telling them |
| 1997 // to throb causes spurious repaints. |
| 1998 throbbing_view_ = nullptr; |
| 1997 } | 1999 } |
| 1998 } else if (bookmarks::IsDescendantOf(node, managed_->managed_node())) { | 2000 } else if (bookmarks::IsDescendantOf(node, managed_->managed_node())) { |
| 1999 throbbing_view_ = managed_bookmarks_button_; | 2001 throbbing_view_ = managed_bookmarks_button_; |
| 2000 } else if (bookmarks::IsDescendantOf(node, managed_->supervised_node())) { | 2002 } else if (bookmarks::IsDescendantOf(node, managed_->supervised_node())) { |
| 2001 throbbing_view_ = supervised_bookmarks_button_; | 2003 throbbing_view_ = supervised_bookmarks_button_; |
| 2002 } else if (!overflow_only) { | 2004 } else if (!overflow_only) { |
| 2003 throbbing_view_ = other_bookmarks_button_; | 2005 throbbing_view_ = other_bookmarks_button_; |
| 2004 } | 2006 } |
| 2005 | 2007 |
| 2006 // Use a large number so that the button continues to throb. | 2008 // Use a large number so that the button continues to throb. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2114 return; | 2116 return; |
| 2115 apps_page_shortcut_->SetVisible(visible); | 2117 apps_page_shortcut_->SetVisible(visible); |
| 2116 UpdateBookmarksSeparatorVisibility(); | 2118 UpdateBookmarksSeparatorVisibility(); |
| 2117 LayoutAndPaint(); | 2119 LayoutAndPaint(); |
| 2118 } | 2120 } |
| 2119 | 2121 |
| 2120 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2122 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
| 2121 if (UpdateOtherAndManagedButtonsVisibility()) | 2123 if (UpdateOtherAndManagedButtonsVisibility()) |
| 2122 LayoutAndPaint(); | 2124 LayoutAndPaint(); |
| 2123 } | 2125 } |
| OLD | NEW |