Chromium Code Reviews| Index: chrome/browser/views/bookmark_bar_view.cc |
| =================================================================== |
| --- chrome/browser/views/bookmark_bar_view.cc (revision 10579) |
| +++ chrome/browser/views/bookmark_bar_view.cc (working copy) |
| @@ -1329,6 +1329,27 @@ |
| } |
| } |
| +void BookmarkBarView::BookmarkNodeChildrenReordered(BookmarkModel* model, |
| + BookmarkNode* node) { |
|
ncarter (slow)
2009/02/27 21:22:34
Please confirm that it's OK to not worry about the
sky
2009/02/27 21:42:06
I added a stop, but no start with a description of
|
| + NotifyModelChanged(); |
| + if (node != model_->GetBookmarkBarNode()) |
| + return; // We only care about reordering of the bookmark bar node. |
| + |
| + // Remove the existing buttons. |
| + while (GetBookmarkButtonCount()) { |
| + views::View* button = GetChildViewAt(0); |
| + RemoveChildView(button); |
| + MessageLoop::current()->DeleteSoon(FROM_HERE, button); |
| + } |
| + |
| + // Create the new buttons. |
| + for (int i = 0; i < node->GetChildCount(); ++i) |
| + AddChildView(i, CreateBookmarkButton(node->GetChild(i))); |
| + |
| + Layout(); |
| + SchedulePaint(); |
| +} |
| + |
| void BookmarkBarView::BookmarkNodeFavIconLoaded(BookmarkModel* model, |
| BookmarkNode* node) { |
| if (menu_runner_.get()) |