Chromium Code Reviews| Index: views/view.cc |
| =================================================================== |
| --- views/view.cc (revision 92366) |
| +++ views/view.cc (working copy) |
| @@ -223,15 +223,6 @@ |
| UpdateTooltip(); |
| } |
| -const View* View::GetChildViewAt(int index) const { |
| - return index < child_count() ? children_[index] : NULL; |
| -} |
| - |
| -View* View::GetChildViewAt(int index) { |
| - return |
| - const_cast<View*>(const_cast<const View*>(this)->GetChildViewAt(index)); |
| -} |
| - |
| bool View::Contains(const View* view) const { |
| for (const View* v = view; v; v = v->parent_) { |
| if (v == this) |
| @@ -540,7 +531,7 @@ |
| // just propagate the Layout() call down the hierarchy, so whoever receives |
| // the call can take appropriate action. |
| for (int i = 0, count = child_count(); i < count; ++i) { |
| - View* child = GetChildViewAt(i); |
| + View* child = child_at(i); |
| if (child->needs_layout_ || !layout_manager_.get()) { |
| child->needs_layout_ = false; |
| child->Layout(); |
| @@ -588,7 +579,7 @@ |
| return const_cast<View*>(this); |
| for (int i = 0, count = child_count(); i < count; ++i) { |
| - const View* view = GetChildViewAt(i)->GetViewByID(id); |
| + const View* view = child_at(i)->GetViewByID(id); |
| if (view) |
| return view; |
| } |
| @@ -618,7 +609,7 @@ |
| out->push_back(this); |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - GetChildViewAt(i)->GetViewsWithGroup(group_id, out); |
| + child_at(i)->GetViewsWithGroup(group_id, out); |
| } |
| View* View::GetSelectedViewForGroup(int group_id) { |
| @@ -801,7 +792,7 @@ |
| // Walk the child Views recursively looking for the View that most |
| // tightly encloses the specified point. |
| for (int i = child_count() - 1; i >= 0; --i) { |
| - View* child = GetChildViewAt(i); |
| + View* child = child_at(i); |
| if (!child->IsVisible()) |
| continue; |
| @@ -1138,7 +1129,7 @@ |
| void View::PaintChildren(gfx::Canvas* canvas) { |
| for (int i = 0, count = child_count(); i < count; ++i) { |
| - View* child = GetChildViewAt(i); |
| + View* child = child_at(i); |
| if (!child) { |
|
sky
2011/07/13 23:54:52
This 'if' no longer makes sense after your change.
|
| NOTREACHED() << "Should not have a NULL child View for index in bounds"; |
| continue; |
| @@ -1180,7 +1171,7 @@ |
| } |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - GetChildViewAt(i)->PaintComposite(); |
| + child_at(i)->PaintComposite(); |
| } |
| void View::SchedulePaintInternal(const gfx::Rect& rect) { |
| @@ -1205,7 +1196,7 @@ |
| } else { |
| // Forward to all children as a descendant may be dirty and have a layer. |
| for (int i = child_count() - 1; i >= 0; --i) { |
| - View* child_view = GetChildViewAt(i); |
| + View* child_view = child_at(i); |
| gfx::Rect child_dirty_rect = dirty_region; |
| child_dirty_rect.Offset(-child_view->GetMirroredX(), -child_view->y()); |
| @@ -1214,7 +1205,7 @@ |
| child_dirty_rect); |
| if (!child_dirty_rect.IsEmpty()) |
| - GetChildViewAt(i)->PaintToLayer(child_dirty_rect); |
| + child_at(i)->PaintToLayer(child_dirty_rect); |
| } |
| } |
| } |
| @@ -1292,7 +1283,7 @@ |
| CreateLayer(); |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - GetChildViewAt(i)->CreateLayerIfNecessary(); |
| + child_at(i)->CreateLayerIfNecessary(); |
| } |
| void View::MoveLayerToParent(ui::Layer* parent_layer, |
| @@ -1306,13 +1297,13 @@ |
| gfx::Rect(local_point.x(), local_point.y(), width(), height())); |
| } else { |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - GetChildViewAt(i)->MoveLayerToParent(parent_layer, local_point); |
| + child_at(i)->MoveLayerToParent(parent_layer, local_point); |
| } |
| } |
| void View::DestroyLayerRecurse() { |
| for (int i = child_count() - 1; i >= 0; --i) |
| - GetChildViewAt(i)->DestroyLayerRecurse(); |
| + child_at(i)->DestroyLayerRecurse(); |
| DestroyLayer(); |
| } |
| @@ -1324,7 +1315,7 @@ |
| } else { |
| gfx::Point new_offset(offset.x() + x(), offset.y() + y()); |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - GetChildViewAt(i)->UpdateLayerBounds(new_offset); |
| + child_at(i)->UpdateLayerBounds(new_offset); |
| } |
| } |
| @@ -1482,7 +1473,7 @@ |
| void View::PropagateRemoveNotifications(View* parent) { |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - GetChildViewAt(i)->PropagateRemoveNotifications(parent); |
| + child_at(i)->PropagateRemoveNotifications(parent); |
| for (View* v = this; v; v = v->parent_) |
| v->ViewHierarchyChangedImpl(true, false, parent, this); |
| @@ -1490,7 +1481,7 @@ |
| void View::PropagateAddNotifications(View* parent, View* child) { |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - GetChildViewAt(i)->PropagateAddNotifications(parent, child); |
| + child_at(i)->PropagateAddNotifications(parent, child); |
| ViewHierarchyChangedImpl(true, true, parent, child); |
| } |
| @@ -1498,7 +1489,7 @@ |
| gfx::NativeView native_view, |
| internal::RootView* root_view) { |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - GetChildViewAt(i)->PropagateNativeViewHierarchyChanged(attached, |
| + child_at(i)->PropagateNativeViewHierarchyChanged(attached, |
| native_view, |
| root_view); |
| NativeViewHierarchyChanged(attached, native_view, root_view); |
| @@ -1533,7 +1524,7 @@ |
| void View::PropagateVisibilityNotifications(View* start, bool is_visible) { |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - GetChildViewAt(i)->PropagateVisibilityNotifications(start, is_visible); |
| + child_at(i)->PropagateVisibilityNotifications(start, is_visible); |
| VisibilityChangedImpl(start, is_visible); |
| } |
| @@ -1608,7 +1599,7 @@ |
| if (view->NeedsNotificationWhenVisibleBoundsChange()) |
| view->RegisterForVisibleBoundsNotification(); |
| for (int i = 0; i < view->child_count(); ++i) |
| - RegisterChildrenForVisibleBoundsNotification(view->GetChildViewAt(i)); |
| + RegisterChildrenForVisibleBoundsNotification(view->child_at(i)); |
| } |
| // static |
| @@ -1616,7 +1607,7 @@ |
| if (view->NeedsNotificationWhenVisibleBoundsChange()) |
| view->UnregisterForVisibleBoundsNotification(); |
| for (int i = 0; i < view->child_count(); ++i) |
| - UnregisterChildrenForVisibleBoundsNotification(view->GetChildViewAt(i)); |
| + UnregisterChildrenForVisibleBoundsNotification(view->child_at(i)); |
| } |
| void View::RegisterForVisibleBoundsNotification() { |
| @@ -1958,13 +1949,13 @@ |
| void View::PropagateThemeChanged() { |
| for (int i = child_count() - 1; i >= 0; --i) |
| - GetChildViewAt(i)->PropagateThemeChanged(); |
| + child_at(i)->PropagateThemeChanged(); |
| OnThemeChanged(); |
| } |
| void View::PropagateLocaleChanged() { |
| for (int i = child_count() - 1; i >= 0; --i) |
| - GetChildViewAt(i)->PropagateLocaleChanged(); |
| + child_at(i)->PropagateLocaleChanged(); |
| OnLocaleChanged(); |
| } |
| @@ -2042,7 +2033,7 @@ |
| // Children. |
| for (int i = 0, count = child_count(); i < count; ++i) |
| - result.append(GetChildViewAt(i)->PrintViewGraph(false)); |
| + result.append(child_at(i)->PrintViewGraph(false)); |
| if (first) |
| result.append("}\n"); |