From 58b359d1055914da02ca1b79ea228118dff5ba44 Mon Sep 17 00:00:00 2001 From: "sky@google.com" Date: Fri, 27 Feb 2009 22:05:08 +0000 Subject: 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 --- chrome/views/tree_model.h | 3 +-- chrome/views/tree_node_model.h | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'chrome/views') 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(children_->size()); -- cgit v1.1