diff options
author | tom.cassiotis@gmail.com <tom.cassiotis@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-10 16:49:18 +0000 |
---|---|---|
committer | tom.cassiotis@gmail.com <tom.cassiotis@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-10 16:49:18 +0000 |
commit | 472f95ed65083a54004c78d2dc519c1bb936fcb1 (patch) | |
tree | c588fa40fd2339059459996f2564dc7c761e2a17 /ui | |
parent | 39841f3451c1063363f2fee3cb32564b18ffb5a9 (diff) | |
download | chromium_src-472f95ed65083a54004c78d2dc519c1bb936fcb1.zip chromium_src-472f95ed65083a54004c78d2dc519c1bb936fcb1.tar.gz chromium_src-472f95ed65083a54004c78d2dc519c1bb936fcb1.tar.bz2 |
BookmarkModel changes for multiple level undo and redo of bookmarks.
Staged commit of a larger feature to ease review and landing the change.
- New BookmarkModelObserver entries to be alerted before an action is
executed.
- BookmarkModel ability to explicitly reorder all children of a bookmark
tree. Support function also added to TreeNode for this operation.
- Test updated BookmarkModel and BookmarkModelObserver changes.
BUG=126092
Review URL: https://chromiumcodereview.appspot.com/16479003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/base/models/tree_node_model.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/base/models/tree_node_model.h b/ui/base/models/tree_node_model.h index 5bfe46e..0ab6ff8 100644 --- a/ui/base/models/tree_node_model.h +++ b/ui/base/models/tree_node_model.h @@ -101,6 +101,14 @@ class TreeNode : public TreeModelNode { children_.weak_clear(); } + // Removes all existing children without deleting the nodes and adds all nodes + // contained in |children| into this node as children. + void SetChildren(const std::vector<NodeType*>& children) { + RemoveAll(); + for (size_t i = 0; i < children.size(); ++i) + Add(children[i], i); + } + // Returns the parent node, or NULL if this is the root node. const NodeType* parent() const { return parent_; } NodeType* parent() { return parent_; } |