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

Unified Diff: views/view.cc

Issue 7076002: views: Get rid of View::SetParent() method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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
« no previous file with comments | « views/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view.cc
diff --git a/views/view.cc b/views/view.cc
index 3b409b6e7549c0a1c078d5d6c043b0e8eaf7802e..3fc06c61e7eb08aee85da6f34626b77aaba25f7d 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -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);
« no previous file with comments | « views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698