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

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

Issue 27262: Wires up sorting of bookmarks to the 'organize menu' in the bookmark... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/bookmark_bar_view.h" 5 #include "chrome/browser/views/bookmark_bar_view.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/base_drag_source.h" 10 #include "base/base_drag_source.h"
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 ConfigureButton(node, button); 1322 ConfigureButton(node, button);
1323 gfx::Size new_pref = button->GetPreferredSize(); 1323 gfx::Size new_pref = button->GetPreferredSize();
1324 if (old_pref.width() != new_pref.width()) { 1324 if (old_pref.width() != new_pref.width()) {
1325 Layout(); 1325 Layout();
1326 SchedulePaint(); 1326 SchedulePaint();
1327 } else if (button->IsVisible()) { 1327 } else if (button->IsVisible()) {
1328 button->SchedulePaint(); 1328 button->SchedulePaint();
1329 } 1329 }
1330 } 1330 }
1331 1331
1332 void BookmarkBarView::BookmarkNodeChildrenReordered(BookmarkModel* model,
1333 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
1334 NotifyModelChanged();
1335 if (node != model_->GetBookmarkBarNode())
1336 return; // We only care about reordering of the bookmark bar node.
1337
1338 // Remove the existing buttons.
1339 while (GetBookmarkButtonCount()) {
1340 views::View* button = GetChildViewAt(0);
1341 RemoveChildView(button);
1342 MessageLoop::current()->DeleteSoon(FROM_HERE, button);
1343 }
1344
1345 // Create the new buttons.
1346 for (int i = 0; i < node->GetChildCount(); ++i)
1347 AddChildView(i, CreateBookmarkButton(node->GetChild(i)));
1348
1349 Layout();
1350 SchedulePaint();
1351 }
1352
1332 void BookmarkBarView::BookmarkNodeFavIconLoaded(BookmarkModel* model, 1353 void BookmarkBarView::BookmarkNodeFavIconLoaded(BookmarkModel* model,
1333 BookmarkNode* node) { 1354 BookmarkNode* node) {
1334 if (menu_runner_.get()) 1355 if (menu_runner_.get())
1335 menu_runner_->FavIconLoaded(node); 1356 menu_runner_->FavIconLoaded(node);
1336 if (drop_menu_runner_.get()) 1357 if (drop_menu_runner_.get())
1337 drop_menu_runner_->FavIconLoaded(node); 1358 drop_menu_runner_->FavIconLoaded(node);
1338 BookmarkNodeChangedImpl(model, node); 1359 BookmarkNodeChangedImpl(model, node);
1339 } 1360 }
1340 1361
1341 void BookmarkBarView::WriteDragData(View* sender, 1362 void BookmarkBarView::WriteDragData(View* sender,
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 } 1881 }
1861 1882
1862 void BookmarkBarView::StopThrobbing(bool immediate) { 1883 void BookmarkBarView::StopThrobbing(bool immediate) {
1863 if (!throbbing_view_) 1884 if (!throbbing_view_)
1864 return; 1885 return;
1865 1886
1866 // If not immediate, cycle through 2 more complete cycles. 1887 // If not immediate, cycle through 2 more complete cycles.
1867 throbbing_view_->StartThrobbing(immediate ? 0 : 4); 1888 throbbing_view_->StartThrobbing(immediate ? 0 : 4);
1868 throbbing_view_ = NULL; 1889 throbbing_view_ = NULL;
1869 } 1890 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698