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

Unified Diff: chrome/browser/ui/views/bookmark_bar_view.cc

Issue 6452011: Rework tree APIs to reflect Google style and more const-correctness.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/bookmark_bar_view.cc
===================================================================
--- chrome/browser/ui/views/bookmark_bar_view.cc (revision 74231)
+++ chrome/browser/ui/views/bookmark_bar_view.cc (working copy)
@@ -927,7 +927,7 @@
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)));
+ AddChildViewAt(CreateBookmarkButton(node->GetChild(i)), i);
UpdateColors();
other_bookmarked_button_->SetVisible(
model->other_node()->GetChildCount() > 0);
@@ -980,7 +980,7 @@
if (!throbbing_view_ && sync_service_ && sync_service_->SetupInProgress()) {
StartThrobbing(node, true);
}
- AddChildView(index, CreateBookmarkButton(node));
+ AddChildViewAt(CreateBookmarkButton(node), index);
UpdateColors();
Layout();
SchedulePaint();
@@ -1057,7 +1057,7 @@
// Create the new buttons.
for (int i = 0, child_count = node->GetChildCount(); i < child_count; ++i)
- AddChildView(i, CreateBookmarkButton(node->GetChild(i)));
+ AddChildViewAt(CreateBookmarkButton(node->GetChild(i)), i);
UpdateColors();
Layout();
@@ -1150,7 +1150,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 +1175,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 +1213,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 +1525,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 +1590,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;
« no previous file with comments | « chrome/browser/ui/views/bookmark_bar_instructions_view.cc ('k') | chrome/browser/ui/views/bookmark_bar_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698