summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 01:38:50 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 01:38:50 +0000
commit3ce9f01e0678bcdf044efeb871fef4179573a3bc (patch)
tree3fbc53f60a12953d163d32802cfa56fe5a062dd4 /views
parent071f94e501d86db8dfa2a3c0806a2388216bb239 (diff)
downloadchromium_src-3ce9f01e0678bcdf044efeb871fef4179573a3bc.zip
chromium_src-3ce9f01e0678bcdf044efeb871fef4179573a3bc.tar.gz
chromium_src-3ce9f01e0678bcdf044efeb871fef4179573a3bc.tar.bz2
Cleanup: Get rid of TreeNodeChildrenReordered.
Reason: This function was never implemented by TreeNodeModel and is unlike it will be. Also it proved to not be necessary at all. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3091016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/tree/tree_view.cc38
-rw-r--r--views/controls/tree/tree_view.h6
2 files changed, 3 insertions, 41 deletions
diff --git a/views/controls/tree/tree_view.cc b/views/controls/tree/tree_view.cc
index e47eda8..8657695 100644
--- a/views/controls/tree/tree_view.cc
+++ b/views/controls/tree/tree_view.cc
@@ -291,44 +291,6 @@ void TreeView::TreeNodesRemoved(TreeModel* model,
}
}
-namespace {
-
-// Callback function used to compare two items. The first two args are the
-// LPARAMs of the HTREEITEMs being compared. The last arg maps from LPARAM
-// to order. This is invoked from TreeNodeChildrenReordered.
-int CALLBACK CompareTreeItems(LPARAM item1_lparam,
- LPARAM item2_lparam,
- LPARAM map_as_lparam) {
- std::map<int, int>& mapping =
- *reinterpret_cast<std::map<int, int>*>(map_as_lparam);
- return mapping[static_cast<int>(item1_lparam)] -
- mapping[static_cast<int>(item2_lparam)];
-}
-
-} // namespace
-
-void TreeView::TreeNodeChildrenReordered(TreeModel* model,
- TreeModelNode* parent) {
- DCHECK(parent);
- if (model_->GetChildCount(parent) <= 1)
- return;
-
- TVSORTCB sort_details;
- sort_details.hParent = GetTreeItemForNodeDuringMutation(parent);
- if (!sort_details.hParent)
- return;
-
- std::map<int, int> lparam_to_order_map;
- for (int i = 0; i < model_->GetChildCount(parent); ++i) {
- TreeModelNode* node = model_->GetChild(parent, i);
- lparam_to_order_map[GetNodeDetails(node)->id] = i;
- }
-
- sort_details.lpfnCompare = &CompareTreeItems;
- sort_details.lParam = reinterpret_cast<LPARAM>(&lparam_to_order_map);
- TreeView_SortChildrenCB(tree_view_, &sort_details, 0);
-}
-
void TreeView::TreeNodeChanged(TreeModel* model, TreeModelNode* node) {
if (node_to_details_map_.find(node) == node_to_details_map_.end()) {
// User hasn't navigated to this entry yet. Ignore the change.
diff --git a/views/controls/tree/tree_view.h b/views/controls/tree/tree_view.h
index 6d1fdac..c97149b 100644
--- a/views/controls/tree/tree_view.h
+++ b/views/controls/tree/tree_view.h
@@ -121,7 +121,8 @@ class TreeView : public NativeControl, TreeModelObserver {
// true.
void SetRootShown(bool root_visible);
- // TreeModelObserver methods. Don't call these directly, instead your model
+ // Begin TreeModelObserver implementation.
+ // Don't call these directly, instead your model
// should notify the observer TreeView adds to it.
virtual void TreeNodesAdded(TreeModel* model,
TreeModelNode* parent,
@@ -131,9 +132,8 @@ class TreeView : public NativeControl, TreeModelObserver {
TreeModelNode* parent,
int start,
int count);
- virtual void TreeNodeChildrenReordered(TreeModel* model,
- TreeModelNode* parent);
virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node);
+ // End TreeModelObserver implementation.
// Sets the controller, which may be null. TreeView does not take ownership
// of the controller.