summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 17:13:33 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 17:13:33 +0000
commitfe84b910e02f66451d9b746d03f761aedfa39032 (patch)
treeba31d5ff4ae9229366bb0675d6dc476fd55645f8 /chrome
parentce2d72c6918e9707ef3dc9987369241108ed239f (diff)
downloadchromium_src-fe84b910e02f66451d9b746d03f761aedfa39032.zip
chromium_src-fe84b910e02f66451d9b746d03f761aedfa39032.tar.gz
chromium_src-fe84b910e02f66451d9b746d03f761aedfa39032.tar.bz2
Convert some more view methods to the ui/views style.
BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7349021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chromeos/login/eula_view.cc2
-rw-r--r--chrome/browser/chromeos/login/views_oobe_display.cc2
-rw-r--r--chrome/browser/chromeos/notifications/balloon_view.cc2
-rw-r--r--chrome/browser/chromeos/notifications/notification_panel.cc21
-rw-r--r--chrome/browser/chromeos/status/status_area_view.cc4
-rw-r--r--chrome/browser/ui/touch/frame/keyboard_container_view.cc2
-rw-r--r--chrome/browser/ui/views/accessibility_event_router_views.cc4
-rw-r--r--chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc12
-rw-r--r--chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.cc6
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc4
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc20
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc7
-rw-r--r--chrome/browser/ui/views/bubble/bubble.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_frame.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_frame_gtk.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc4
-rw-r--r--chrome/browser/ui/views/frame/browser_view_layout.cc12
-rw-r--r--chrome/browser/ui/views/infobars/infobar_container_view.cc2
-rw-r--r--chrome/browser/ui/views/infobars/infobar_view.cc2
-rw-r--r--chrome/browser/ui/views/wrench_menu.cc4
-rw-r--r--chrome/test/interactive_ui/view_event_test_base.cc2
21 files changed, 56 insertions, 62 deletions
diff --git a/chrome/browser/chromeos/login/eula_view.cc b/chrome/browser/chromeos/login/eula_view.cc
index a7778f2..8f4e729 100644
--- a/chrome/browser/chromeos/login/eula_view.cc
+++ b/chrome/browser/chromeos/login/eula_view.cc
@@ -73,7 +73,7 @@ struct FillLayoutWithBorder : public views::LayoutManager {
// Overridden from LayoutManager:
virtual void Layout(views::View* host) {
DCHECK(host->has_children());
- host->GetChildViewAt(0)->SetBoundsRect(host->GetContentsBounds());
+ host->child_at(0)->SetBoundsRect(host->GetContentsBounds());
}
virtual gfx::Size GetPreferredSize(views::View* host) {
return gfx::Size(host->width(), host->height());
diff --git a/chrome/browser/chromeos/login/views_oobe_display.cc b/chrome/browser/chromeos/login/views_oobe_display.cc
index 3863d3f..49b0c81 100644
--- a/chrome/browser/chromeos/login/views_oobe_display.cc
+++ b/chrome/browser/chromeos/login/views_oobe_display.cc
@@ -101,7 +101,7 @@ class ContentView : public views::View {
virtual void Layout() {
for (int i = 0; i < child_count(); ++i) {
- views::View* cur = GetChildViewAt(i);
+ views::View* cur = child_at(i);
if (cur->IsVisible())
cur->SetBounds(0, 0, width(), height());
}
diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc
index f23cd8f..659a900 100644
--- a/chrome/browser/chromeos/notifications/balloon_view.cc
+++ b/chrome/browser/chromeos/notifications/balloon_view.cc
@@ -330,7 +330,7 @@ void BalloonViewImpl::Activated() {
// Get the size of Control View.
gfx::Size size =
- control_view_host_->GetRootView()->GetChildViewAt(0)->GetPreferredSize();
+ control_view_host_->GetRootView()->child_at(0)->GetPreferredSize();
control_view_host_->Show();
control_view_host_->SetBounds(
gfx::Rect(width() - size.width() - kControlViewRightMargin,
diff --git a/chrome/browser/chromeos/notifications/notification_panel.cc b/chrome/browser/chromeos/notifications/notification_panel.cc
index 7bb6114..1a3b058 100644
--- a/chrome/browser/chromeos/notifications/notification_panel.cc
+++ b/chrome/browser/chromeos/notifications/notification_panel.cc
@@ -154,7 +154,7 @@ class BalloonSubContainer : public views::View {
// Layout bottom up
int height = 0;
for (int i = child_count() - 1; i >= 0; --i) {
- views::View* child = GetChildViewAt(i);
+ views::View* child = child_at(i);
child->SetBounds(0, height, child->width(), child->height());
height += child->height() + margin_;
}
@@ -166,7 +166,7 @@ class BalloonSubContainer : public views::View {
int height = 0;
int max_width = 0;
for (int i = child_count() - 1; i >= 0; --i) {
- views::View* child = GetChildViewAt(i);
+ views::View* child = child_at(i);
height += child->height() + margin_;
max_width = std::max(max_width, child->width());
}
@@ -181,8 +181,7 @@ class BalloonSubContainer : public views::View {
gfx::Rect GetNewBounds() {
gfx::Rect rect;
for (int i = child_count() - 1; i >= 0; --i) {
- BalloonViewImpl* view =
- static_cast<BalloonViewImpl*>(GetChildViewAt(i));
+ BalloonViewImpl* view = static_cast<BalloonViewImpl*>(child_at(i));
if (!view->stale()) {
if (rect.IsEmpty()) {
rect = view->bounds();
@@ -198,8 +197,7 @@ class BalloonSubContainer : public views::View {
int GetNewCount() {
int count = 0;
for (int i = child_count() - 1; i >= 0; --i) {
- BalloonViewImpl* view =
- static_cast<BalloonViewImpl*>(GetChildViewAt(i));
+ BalloonViewImpl* view = static_cast<BalloonViewImpl*>(child_at(i));
if (!view->stale())
count++;
}
@@ -209,24 +207,21 @@ class BalloonSubContainer : public views::View {
// Make all notifications stale.
void MakeAllStale() {
for (int i = child_count() - 1; i >= 0; --i) {
- BalloonViewImpl* view =
- static_cast<BalloonViewImpl*>(GetChildViewAt(i));
+ BalloonViewImpl* view = static_cast<BalloonViewImpl*>(child_at(i));
view->set_stale();
}
}
void DismissAll() {
for (int i = child_count() - 1; i >= 0; --i) {
- BalloonViewImpl* view =
- static_cast<BalloonViewImpl*>(GetChildViewAt(i));
+ BalloonViewImpl* view = static_cast<BalloonViewImpl*>(child_at(i));
view->Close(true);
}
}
BalloonViewImpl* FindBalloonView(const Notification& notification) {
for (int i = child_count() - 1; i >= 0; --i) {
- BalloonViewImpl* view =
- static_cast<BalloonViewImpl*>(GetChildViewAt(i));
+ BalloonViewImpl* view = static_cast<BalloonViewImpl*>(child_at(i));
if (view->IsFor(notification)) {
return view;
}
@@ -238,7 +233,7 @@ class BalloonSubContainer : public views::View {
gfx::Point copy(point);
ConvertPointFromWidget(this, &copy);
for (int i = child_count() - 1; i >= 0; --i) {
- views::View* view = GetChildViewAt(i);
+ views::View* view = child_at(i);
if (view->bounds().Contains(copy))
return static_cast<BalloonViewImpl*>(view);
}
diff --git a/chrome/browser/chromeos/status/status_area_view.cc b/chrome/browser/chromeos/status/status_area_view.cc
index b1b07f6..161edfb 100644
--- a/chrome/browser/chromeos/status/status_area_view.cc
+++ b/chrome/browser/chromeos/status/status_area_view.cc
@@ -60,7 +60,7 @@ gfx::Size StatusAreaView::GetPreferredSize() {
int result_h = 0;
for (int i = 0; i < child_count(); i++) {
- views::View* cur = GetChildViewAt(i);
+ views::View* cur = child_at(i);
gfx::Size cur_size = cur->GetPreferredSize();
if (cur->IsVisible() && !cur_size.IsEmpty()) {
if (result_w == 0)
@@ -78,7 +78,7 @@ gfx::Size StatusAreaView::GetPreferredSize() {
void StatusAreaView::Layout() {
int cur_x = kSeparation;
for (int i = 0; i < child_count(); i++) {
- views::View* cur = GetChildViewAt(i);
+ views::View* cur = child_at(i);
gfx::Size cur_size = cur->GetPreferredSize();
if (cur->IsVisible() && !cur_size.IsEmpty()) {
int cur_y = (height() - cur_size.height()) / 2;
diff --git a/chrome/browser/ui/touch/frame/keyboard_container_view.cc b/chrome/browser/ui/touch/frame/keyboard_container_view.cc
index 64162a6..b8c0b80 100644
--- a/chrome/browser/ui/touch/frame/keyboard_container_view.cc
+++ b/chrome/browser/ui/touch/frame/keyboard_container_view.cc
@@ -17,7 +17,7 @@ namespace {
void MakeViewHierarchyUnfocusable(views::View* view) {
view->set_focusable(false);
for (int i = 0; i < view->child_count(); ++i) {
- MakeViewHierarchyUnfocusable(view->GetChildViewAt(i));
+ MakeViewHierarchyUnfocusable(view->child_at(i));
}
}
diff --git a/chrome/browser/ui/views/accessibility_event_router_views.cc b/chrome/browser/ui/views/accessibility_event_router_views.cc
index 218008e..ce29967 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views.cc
+++ b/chrome/browser/ui/views/accessibility_event_router_views.cc
@@ -318,7 +318,7 @@ void AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount(
int* index,
int* count) {
for (int i = 0; i < menu->child_count(); ++i) {
- views::View* child = menu->GetChildViewAt(i);
+ views::View* child = menu->child_at(i);
int previous_count = *count;
RecursiveGetMenuItemIndexAndCount(child, item, index, count);
if (child->GetClassName() == views::MenuItemView::kViewClassName &&
@@ -342,7 +342,7 @@ std::string AccessibilityEventRouterViews::RecursiveGetStaticText(
return UTF16ToUTF8(state.name);
for (int i = 0; i < view->child_count(); ++i) {
- views::View* child = view->GetChildViewAt(i);
+ views::View* child = view->child_at(i);
std::string result = RecursiveGetStaticText(child);
if (!result.empty())
return result;
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
index b364a5f..92c55cc 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
@@ -274,7 +274,7 @@ void AutocompletePopupContentsView::LayoutChildren() {
gfx::Rect contents_rect = GetContentsBounds();
int top = contents_rect.y();
for (int i = 0; i < child_count(); ++i) {
- View* v = GetChildViewAt(i);
+ View* v = child_at(i);
if (v->IsVisible()) {
v->SetBounds(contents_rect.x(), top, contents_rect.width(),
v->GetPreferredSize().height());
@@ -291,7 +291,7 @@ bool AutocompletePopupContentsView::IsOpen() const {
}
void AutocompletePopupContentsView::InvalidateLine(size_t line) {
- GetChildViewAt(static_cast<int>(line))->SchedulePaint();
+ child_at(static_cast<int>(line))->SchedulePaint();
}
void AutocompletePopupContentsView::UpdatePopupAppearance() {
@@ -323,13 +323,13 @@ void AutocompletePopupContentsView::UpdatePopupAppearance() {
CreateResultView(this, i, result_font_, result_bold_font_);
AddChildViewAt(result_view, static_cast<int>(i));
} else {
- result_view = static_cast<AutocompleteResultView*>(GetChildViewAt(i));
+ result_view = static_cast<AutocompleteResultView*>(child_at(i));
result_view->SetVisible(true);
}
result_view->SetMatch(GetMatchAtIndex(i));
}
for (size_t i = model_->result().size(); i < child_rv_count; ++i)
- GetChildViewAt(i)->SetVisible(false);
+ child_at(i)->SetVisible(false);
PromoCounter* counter = model_->profile()->GetInstantPromoCounter();
if (!opt_in_view_ && counter && counter->ShouldShow(base::Time::Now())) {
@@ -515,7 +515,7 @@ int AutocompletePopupContentsView::CalculatePopupHeight() {
DCHECK_GE(static_cast<size_t>(child_count()), model_->result().size());
int popup_height = 0;
for (size_t i = 0; i < model_->result().size(); ++i)
- popup_height += GetChildViewAt(i)->GetPreferredSize().height();
+ popup_height += child_at(i)->GetPreferredSize().height();
return popup_height +
(opt_in_view_ ? opt_in_view_->GetPreferredSize().height() : 0);
}
@@ -659,7 +659,7 @@ size_t AutocompletePopupContentsView::GetIndexForPoint(
int nb_match = model_->result().size();
DCHECK(nb_match <= child_count());
for (int i = 0; i < nb_match; ++i) {
- views::View* child = GetChildViewAt(i);
+ views::View* child = child_at(i);
gfx::Point point_in_child_coords(point);
View::ConvertPointToView(this, child, &point_in_child_coords);
if (child->HitTest(point_in_child_coords))
diff --git a/chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.cc
index 0ea17b6..db590db 100644
--- a/chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.cc
+++ b/chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.cc
@@ -107,7 +107,7 @@ int TouchAutocompletePopupContentsView::CalculatePopupHeight() {
int popup_height = 0;
for (size_t i = 0; i < model_->result().size(); ++i) {
popup_height = std::max(popup_height,
- GetChildViewAt(i)->GetPreferredSize().height());
+ child_at(i)->GetPreferredSize().height());
}
popup_height = std::max(popup_height, opt_in_view_ ?
opt_in_view_->GetPreferredSize().height() : 0);
@@ -126,8 +126,8 @@ std::vector<views::View*>
TouchAutocompletePopupContentsView::GetVisibleChildren() {
std::vector<View*> visible_children;
for (int i = 0; i < child_count(); ++i) {
- View* v = GetChildViewAt(i);
- if (GetChildViewAt(i)->IsVisible())
+ View* v = child_at(i);
+ if (child_at(i)->IsVisible())
visible_children.push_back(v);
}
return visible_children;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc
index ea82275..85c3c5c 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc
@@ -42,7 +42,7 @@ BookmarkBarInstructionsView::BookmarkBarInstructionsView(Delegate* delegate)
gfx::Size BookmarkBarInstructionsView::GetPreferredSize() {
int ascent = 0, descent = 0, height = 0, width = 0;
for (int i = 0; i < child_count(); ++i) {
- views::View* view = GetChildViewAt(i);
+ views::View* view = child_at(i);
gfx::Size pref = view->GetPreferredSize();
int baseline = view->GetBaseline();
if (baseline != -1) {
@@ -63,7 +63,7 @@ void BookmarkBarInstructionsView::Layout() {
int remaining_width = width();
int x = 0;
for (int i = 0; i < child_count(); ++i) {
- views::View* view = GetChildViewAt(i);
+ views::View* view = child_at(i);
gfx::Size pref = view->GetPreferredSize();
int baseline = view->GetBaseline();
int y;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 76f1663..8a54bef 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -434,7 +434,7 @@ void BookmarkBarView::SetProfile(Profile* profile) {
// Remove any existing bookmark buttons.
while (GetBookmarkButtonCount())
- delete GetChildViewAt(0);
+ delete child_at(0);
model_ = profile_->GetBookmarkModel();
if (model_) {
@@ -496,7 +496,7 @@ const BookmarkNode* BookmarkBarView::GetNodeForButtonAtModelIndex(
// Check the buttons first.
for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
- views::View* child = GetChildViewAt(i);
+ views::View* child = child_at(i);
if (!child->IsVisible())
break;
if (child->bounds().Contains(adjusted_loc))
@@ -528,7 +528,7 @@ views::MenuButton* BookmarkBarView::GetMenuButtonForNode(
int index = model_->GetBookmarkBarNode()->GetIndexOf(node);
if (index == -1 || !node->is_folder())
return NULL;
- return static_cast<views::MenuButton*>(GetChildViewAt(index));
+ return static_cast<views::MenuButton*>(child_at(index));
}
void BookmarkBarView::GetAnchorPositionForButton(
@@ -966,7 +966,7 @@ void BookmarkBarView::BookmarkNodeChildrenReordered(BookmarkModel* model,
// Remove the existing buttons.
while (GetBookmarkButtonCount()) {
- views::View* button = GetChildViewAt(0);
+ views::View* button = child_at(0);
RemoveChildView(button);
MessageLoop::current()->DeleteSoon(FROM_HERE, button);
}
@@ -1212,7 +1212,7 @@ int BookmarkBarView::GetBookmarkButtonCount() {
views::TextButton* BookmarkBarView::GetBookmarkButton(int index) {
DCHECK(index >= 0 && index < GetBookmarkButtonCount());
- return static_cast<views::TextButton*>(GetChildViewAt(index));
+ return static_cast<views::TextButton*>(child_at(index));
}
int BookmarkBarView::GetFirstHiddenNodeIndex() {
@@ -1349,7 +1349,7 @@ void BookmarkBarView::BookmarkNodeRemovedImpl(BookmarkModel* model,
return;
}
DCHECK(index >= 0 && index < GetBookmarkButtonCount());
- views::View* button = GetChildViewAt(index);
+ views::View* button = child_at(index);
RemoveChildView(button);
MessageLoop::current()->DeleteSoon(FROM_HERE, button);
Layout();
@@ -1554,7 +1554,7 @@ void BookmarkBarView::StartThrobbing(const BookmarkNode* node,
// Node is hidden, animate the overflow button.
throbbing_view_ = overflow_button_;
} else if (!overflow_only) {
- throbbing_view_ = static_cast<CustomButton*>(GetChildViewAt(index));
+ throbbing_view_ = static_cast<CustomButton*>(child_at(index));
}
} else if (!overflow_only) {
throbbing_view_ = other_bookmarked_button_;
@@ -1584,7 +1584,7 @@ views::CustomButton* BookmarkBarView::DetermineViewToThrobFromRemove(
// Node is hidden, animate the overflow button.
return overflow_button_;
}
- return static_cast<CustomButton*>(GetChildViewAt(old_index_on_bb));
+ return static_cast<CustomButton*>(child_at(old_index_on_bb));
}
// Node wasn't on the bookmark bar, use the other bookmark button.
return other_bookmarked_button_;
@@ -1674,7 +1674,7 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) {
instructions_->SetVisible(false);
for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
- views::View* child = GetChildViewAt(i);
+ views::View* child = child_at(i);
gfx::Size pref = child->GetPreferredSize();
int next_x = x + pref.width() + kButtonPadding;
if (!compute_bounds_only) {
@@ -1688,7 +1688,7 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) {
// Layout the right side of the bar.
const bool all_visible =
(GetBookmarkButtonCount() == 0 ||
- GetChildViewAt(GetBookmarkButtonCount() - 1)->IsVisible());
+ child_at(GetBookmarkButtonCount() - 1)->IsVisible());
// Layout the right side buttons.
if (!compute_bounds_only)
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index 07d76da..225284f 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -839,7 +839,7 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase {
ASSERT_TRUE(scroll_container != NULL);
scroll_container = scroll_container->parent();
ASSERT_TRUE(scroll_container != NULL);
- views::View* scroll_down_button = scroll_container->GetChildViewAt(1);
+ views::View* scroll_down_button = scroll_container->child_at(1);
ASSERT_TRUE(scroll_down_button);
gfx::Point loc(scroll_down_button->width() / 2,
scroll_down_button->height() / 2);
@@ -1188,9 +1188,8 @@ class BookmarkBarViewTest13 : public BookmarkBarViewEventTestBase {
views::SubmenuView* submenu = menu->GetSubmenu();
views::View* separator_view = NULL;
for (int i = 0; i < submenu->child_count(); ++i) {
- if (submenu->GetChildViewAt(i)->id() !=
- views::MenuItemView::kMenuItemViewID) {
- separator_view = submenu->GetChildViewAt(i);
+ if (submenu->child_at(i)->id() != views::MenuItemView::kMenuItemViewID) {
+ separator_view = submenu->child_at(i);
break;
}
}
diff --git a/chrome/browser/ui/views/bubble/bubble.cc b/chrome/browser/ui/views/bubble/bubble.cc
index 4c4f6a6..02b2cdf7 100644
--- a/chrome/browser/ui/views/bubble/bubble.cc
+++ b/chrome/browser/ui/views/bubble/bubble.cc
@@ -335,7 +335,7 @@ void Bubble::OnActivate(UINT action, BOOL minimized, HWND window) {
GetWidget()->Close();
} else if (action == WA_ACTIVE) {
DCHECK(GetWidget()->GetRootView()->has_children());
- GetWidget()->GetRootView()->GetChildViewAt(0)->RequestFocus();
+ GetWidget()->GetRootView()->child_at(0)->RequestFocus();
}
}
#elif defined(TOOLKIT_USES_GTK)
diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc
index 4da7f4d..62c66b6 100644
--- a/chrome/browser/ui/views/frame/browser_frame.cc
+++ b/chrome/browser/ui/views/frame/browser_frame.cc
@@ -74,7 +74,7 @@ views::View* BrowserFrame::GetFrameView() const {
void BrowserFrame::TabStripDisplayModeChanged() {
if (GetRootView()->has_children()) {
// Make sure the child of the root view gets Layout again.
- GetRootView()->GetChildViewAt(0)->InvalidateLayout();
+ GetRootView()->child_at(0)->InvalidateLayout();
}
GetRootView()->Layout();
native_browser_frame_->TabStripDisplayModeChanged();
diff --git a/chrome/browser/ui/views/frame/browser_frame_gtk.cc b/chrome/browser/ui/views/frame/browser_frame_gtk.cc
index 96d302c..b1e7d87 100644
--- a/chrome/browser/ui/views/frame/browser_frame_gtk.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_gtk.cc
@@ -53,7 +53,7 @@ int BrowserFrameGtk::GetMinimizeButtonOffset() const {
void BrowserFrameGtk::TabStripDisplayModeChanged() {
if (GetWidget()->GetRootView()->has_children()) {
// Make sure the child of the root view gets Layout again.
- GetWidget()->GetRootView()->GetChildViewAt(0)->InvalidateLayout();
+ GetWidget()->GetRootView()->child_at(0)->InvalidateLayout();
}
GetWidget()->GetRootView()->Layout();
}
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 8ec5e24..4e852a1 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1821,7 +1821,7 @@ void BrowserView::PaintChildren(gfx::Canvas* canvas) {
// Paint the |infobar_container_| last so that it may paint its
// overlapping tabs.
for (int i = 0; i < child_count(); ++i) {
- View* child = GetChildViewAt(i);
+ View* child = child_at(i);
if (child != infobar_container_)
child->Paint(canvas);
}
@@ -1870,7 +1870,7 @@ bool BrowserView::DrawInfoBarArrows(int* x) const {
bool BrowserView::SplitHandleMoved(views::SingleSplitView* view) {
for (int i = 0; i < view->child_count(); ++i)
- view->GetChildViewAt(i)->InvalidateLayout();
+ view->child_at(i)->InvalidateLayout();
SchedulePaint();
Layout();
return false;
diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc
index d94b776..e78ac75 100644
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -546,7 +546,7 @@ void BrowserViewLayout::LayoutTabContents(int top, int bottom) {
views::SingleSplitView* sidebar_split = browser_view_->sidebar_split_;
if (sidebar_split) {
- DCHECK(sidebar_split == contents_split_->GetChildViewAt(0));
+ DCHECK(sidebar_split == contents_split_->child_at(0));
sidebar_split->CalculateChildrenBounds(
sidebar_split_bounds, &contents_bounds, &sidebar_bounds);
} else {
@@ -599,14 +599,14 @@ int BrowserViewLayout::GetTopMarginForActiveContent() {
return 0;
}
- if (contents_split_->GetChildViewAt(1) &&
- contents_split_->GetChildViewAt(1)->IsVisible())
+ if (contents_split_->child_at(1) &&
+ contents_split_->child_at(1)->IsVisible())
return 0;
if (SidebarManager::IsSidebarAllowed()) {
- views::View* sidebar_split = contents_split_->GetChildViewAt(0);
- if (sidebar_split->GetChildViewAt(1) &&
- sidebar_split->GetChildViewAt(1)->IsVisible())
+ views::View* sidebar_split = contents_split_->child_at(0);
+ if (sidebar_split->child_count() >= 2 &&
+ sidebar_split->child_at(1)->IsVisible())
return 0;
}
diff --git a/chrome/browser/ui/views/infobars/infobar_container_view.cc b/chrome/browser/ui/views/infobars/infobar_container_view.cc
index d9e0e14..1ae3dd5 100644
--- a/chrome/browser/ui/views/infobars/infobar_container_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_container_view.cc
@@ -32,7 +32,7 @@ void InfoBarContainerView::Layout() {
int top = GetVerticalOverlap(NULL);
for (int i = 0; i < child_count(); ++i) {
- InfoBarView* child = static_cast<InfoBarView*>(GetChildViewAt(i));
+ InfoBarView* child = static_cast<InfoBarView*>(child_at(i));
top -= child->arrow_height();
int child_height = child->total_height();
child->SetBounds(0, top, width(), child_height);
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc
index 15cfbda..b979c75 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -230,7 +230,7 @@ void InfoBarView::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
AddChildView(close_button_);
} else if ((close_button_ != NULL) && (parent == this) &&
(child != close_button_) && (close_button_->parent() == this) &&
- (GetChildViewAt(child_count() - 1) != close_button_)) {
+ (child_at(child_count() - 1) != close_button_)) {
// For accessibility, ensure the close button is the last child view.
RemoveChildView(close_button_);
AddChildView(close_button_);
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index c08882f..e84ac23 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -351,7 +351,7 @@ class WrenchMenu::CutCopyPasteView : public WrenchMenuView {
// All buttons are given the same width.
int width = GetMaxChildViewPreferredWidth();
for (int i = 0; i < child_count(); ++i)
- GetChildViewAt(i)->SetBounds(i * width, 0, width, height());
+ child_at(i)->SetBounds(i * width, 0, width, height());
}
// ButtonListener
@@ -364,7 +364,7 @@ class WrenchMenu::CutCopyPasteView : public WrenchMenuView {
int GetMaxChildViewPreferredWidth() {
int width = 0;
for (int i = 0; i < child_count(); ++i)
- width = std::max(width, GetChildViewAt(i)->GetPreferredSize().width());
+ width = std::max(width, child_at(i)->GetPreferredSize().width());
return width;
}
diff --git a/chrome/test/interactive_ui/view_event_test_base.cc b/chrome/test/interactive_ui/view_event_test_base.cc
index 77e4479..3a32538 100644
--- a/chrome/test/interactive_ui/view_event_test_base.cc
+++ b/chrome/test/interactive_ui/view_event_test_base.cc
@@ -35,7 +35,7 @@ class TestView : public views::View {
}
virtual void Layout() {
- View* child_view = GetChildViewAt(0);
+ View* child_view = child_at(0);
child_view->SetBounds(0, 0, width(), height());
}