diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-27 22:05:08 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-27 22:05:08 +0000 |
commit | 58b359d1055914da02ca1b79ea228118dff5ba44 (patch) | |
tree | cfd33e8ddbaf6afed4a6df441799320d758e7577 /chrome/views | |
parent | cb9bb1317104cc8a7f219fdaeec45723a9e59e0e (diff) | |
download | chromium_src-58b359d1055914da02ca1b79ea228118dff5ba44.zip chromium_src-58b359d1055914da02ca1b79ea228118dff5ba44.tar.gz chromium_src-58b359d1055914da02ca1b79ea228118dff5ba44.tar.bz2 |
Wires up sorting of bookmarks to the 'organize menu' in the bookmark
manager (Glen says no context menus for now). All
BookmarkModelObservers have been updated appropriately.
BUG=1750
TEST=bring up the bookmark manager and try the 'Reorder by title' menu
item, make sure it works and I didn't screw up anything around it.
Review URL: http://codereview.chromium.org/27262
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10633 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r-- | chrome/views/tree_model.h | 3 | ||||
-rw-r--r-- | chrome/views/tree_node_model.h | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/chrome/views/tree_model.h b/chrome/views/tree_model.h index 3608fbc..70be773 100644 --- a/chrome/views/tree_model.h +++ b/chrome/views/tree_model.h @@ -41,9 +41,8 @@ class TreeModelObserver { // Notification the children of |parent| have been reordered. Note, only // the direct children of |parent| have been reordered, not descendants. - // TODO(sky): make this pure virtual after all sites have been updated. virtual void TreeNodeChildrenReordered(TreeModel* model, - TreeModelNode* parent) {} + TreeModelNode* parent) = 0; // Notification that the contents of a node has changed. virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) = 0; 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()); |