Commit b5fe7445 authored by tfarina@chromium.org's avatar tfarina@chromium.org

views: Get rid of View::SetParent() method.

This method is private to View class, and thus can be removed.

BUG=72040
TEST=None

R=ben@chromium.org

Review URL: http://codereview.chromium.org/7076002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86775 0039d316-1c4b-4281-b951-d872f2087c98
parent dbff0a42
......@@ -126,7 +126,7 @@ View::~View() {
int c = static_cast<int>(children_.size());
while (--c >= 0) {
children_[c]->SetParent(NULL);
children_[c]->parent_ = NULL;
if (children_[c]->IsParentOwned())
delete children_[c];
}
......@@ -164,7 +164,7 @@ void View::AddChildViewAt(View* view, int index) {
// Let's insert the view.
children_.insert(children_.begin() + index, view);
view->SetParent(this);
view->parent_ = this;
for (View* p = this; p; p = p->parent())
p->ViewHierarchyChangedImpl(false, true, this, view);
......@@ -1343,7 +1343,7 @@ void View::DoRemoveChildView(View* view,
UnregisterChildrenForVisibleBoundsNotification(view);
view->ResetTexture();
view->PropagateRemoveNotifications(this);
view->SetParent(NULL);
view->parent_ = NULL;
if (delete_removed_view && view->IsParentOwned())
view_to_be_deleted.reset(view);
......@@ -1358,11 +1358,6 @@ void View::DoRemoveChildView(View* view,
layout_manager_->ViewRemoved(this, view);
}
void View::SetParent(View* parent) {
if (parent != parent_)
parent_ = parent;
}
void View::PropagateRemoveNotifications(View* parent) {
for (int i = 0, count = child_count(); i < count; ++i)
GetChildViewAt(i)->PropagateRemoveNotifications(parent);
......
......@@ -1163,10 +1163,6 @@ class View : public AcceleratorTarget {
bool update_tool_tip,
bool delete_removed_view);
// Sets the parent View. This is called automatically by AddChild and is
// thus private.
void SetParent(View* parent);
// Call ViewHierarchyChanged for all child views on all parents
void PropagateRemoveNotifications(View* parent);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment