summaryrefslogtreecommitdiffstats
path: root/chrome/views/tree_node_model.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views/tree_node_model.h')
-rw-r--r--chrome/views/tree_node_model.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/views/tree_node_model.h b/chrome/views/tree_node_model.h
index 52126d6..eb7e290 100644
--- a/chrome/views/tree_node_model.h
+++ b/chrome/views/tree_node_model.h
@@ -92,6 +92,13 @@ class TreeNode : public TreeModelNode {
return node;
}
+ // Removes all the children from this node. This does NOT delete the nodes.
+ void RemoveAll() {
+ for (size_t i = 0; i < children_->size(); ++i)
+ children_[i]->parent_ = NULL;
+ children_->clear();
+ }
+
// Returns the number of children.
int GetChildCount() {
return static_cast<int>(children_->size());