| Index: chrome/browser/ui/views/bookmark_bar_view.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/bookmark_bar_view.cc (revision 74117)
|
| +++ chrome/browser/ui/views/bookmark_bar_view.cc (working copy)
|
| @@ -926,8 +926,10 @@
|
| const BookmarkNode* node = model_->GetBookmarkBarNode();
|
| DCHECK(node && model_->other_node());
|
| // Create a button for each of the children on the bookmark bar.
|
| - for (int i = 0, child_count = node->GetChildCount(); i < child_count; ++i)
|
| - AddChildView(i, CreateBookmarkButton(node->GetChild(i)));
|
| + for (size_t i = 0, child_count = node->GetChildCount();
|
| + static_cast<int>(i) < child_count; ++i) {
|
| + AddChildViewAt(CreateBookmarkButton(node->GetChild(i)), i);
|
| + }
|
| UpdateColors();
|
| other_bookmarked_button_->SetVisible(
|
| model->other_node()->GetChildCount() > 0);
|
| @@ -980,7 +982,7 @@
|
| if (!throbbing_view_ && sync_service_ && sync_service_->SetupInProgress()) {
|
| StartThrobbing(node, true);
|
| }
|
| - AddChildView(index, CreateBookmarkButton(node));
|
| + AddChildViewAt(CreateBookmarkButton(node), index);
|
| UpdateColors();
|
| Layout();
|
| SchedulePaint();
|
| @@ -1056,8 +1058,10 @@
|
| }
|
|
|
| // Create the new buttons.
|
| - for (int i = 0, child_count = node->GetChildCount(); i < child_count; ++i)
|
| - AddChildView(i, CreateBookmarkButton(node->GetChild(i)));
|
| + for (size_t i = 0, child_count = node->GetChildCount();
|
| + static_cast<int>(i) < child_count; ++i) {
|
| + AddChildViewAt(CreateBookmarkButton(node->GetChild(i)), i);
|
| + }
|
| UpdateColors();
|
|
|
| Layout();
|
| @@ -1150,7 +1154,7 @@
|
| node = model_->GetBookmarkBarNode();
|
| start_index = GetFirstHiddenNodeIndex();
|
| } else {
|
| - int button_index = GetChildIndex(view);
|
| + int button_index = GetIndexOf(view);
|
| DCHECK_NE(-1, button_index);
|
| node = model_->GetBookmarkBarNode()->GetChild(button_index);
|
| }
|
| @@ -1175,7 +1179,7 @@
|
| if (sender->tag() == kOtherFolderButtonTag) {
|
| node = model_->other_node();
|
| } else {
|
| - int index = GetChildIndex(sender);
|
| + int index = GetIndexOf(sender);
|
| DCHECK_NE(-1, index);
|
| node = model_->GetBookmarkBarNode()->GetChild(index);
|
| }
|
| @@ -1213,7 +1217,7 @@
|
| } else if (source != this) {
|
| // User clicked on one of the bookmark buttons, find which one they
|
| // clicked on.
|
| - int bookmark_button_index = GetChildIndex(source);
|
| + int bookmark_button_index = GetIndexOf(source);
|
| DCHECK(bookmark_button_index != -1 &&
|
| bookmark_button_index < GetBookmarkButtonCount());
|
| const BookmarkNode* node =
|
| @@ -1525,7 +1529,7 @@
|
| // We contain five non-bookmark button views: other bookmarks, bookmarks
|
| // separator, chevrons (for overflow), the instruction label and the sync
|
| // error button.
|
| - return GetChildViewCount() - 5;
|
| + return child_count() - 5;
|
| }
|
|
|
| void BookmarkBarView::StopThrobbing(bool immediate) {
|
| @@ -1590,7 +1594,7 @@
|
|
|
| gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) {
|
| gfx::Size prefsize;
|
| - if (!GetParent() && !compute_bounds_only)
|
| + if (!parent() && !compute_bounds_only)
|
| return prefsize;
|
|
|
| int x = kLeftMargin;
|
|
|