diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 23:07:58 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 23:07:58 +0000 |
commit | 42062e78622add4b84f872707530670d4894d5c9 (patch) | |
tree | 57555878cc6583012dbc2db4c3842282d1ec6ac5 /app | |
parent | dda7d9c65875b7650f36fa8c2a03b5813dc3ecd3 (diff) | |
download | chromium_src-42062e78622add4b84f872707530670d4894d5c9.zip chromium_src-42062e78622add4b84f872707530670d4894d5c9.tar.gz chromium_src-42062e78622add4b84f872707530670d4894d5c9.tar.bz2 |
Linux: Convert Cookies options page from a list into a tree.
Add gtk_tree::TreeAdapter class.
BUG=26713
TEST=compare behavior to windows impl
Review URL: http://codereview.chromium.org/371079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31732 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r-- | app/tree_model.h | 3 | ||||
-rw-r--r-- | app/tree_node_model.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/tree_model.h b/app/tree_model.h index f6d8da3..e82aa38 100644 --- a/app/tree_model.h +++ b/app/tree_model.h @@ -62,6 +62,9 @@ class TreeModel { // Returns the child node at the specified index. virtual TreeModelNode* GetChild(TreeModelNode* parent, int index) = 0; + // Returns the index of child node at the specified index. + virtual int IndexOfChild(TreeModelNode* parent, TreeModelNode* child) = 0; + // Returns the parent of a node, or NULL if node is the root. virtual TreeModelNode* GetParent(TreeModelNode* node) = 0; diff --git a/app/tree_node_model.h b/app/tree_node_model.h index 2d84050..74aaed0 100644 --- a/app/tree_node_model.h +++ b/app/tree_node_model.h @@ -239,6 +239,11 @@ class TreeNodeModel : public TreeModel { return AsNode(parent)->GetChild(index); } + virtual int IndexOfChild(TreeModelNode* parent, TreeModelNode* child) { + DCHECK(parent); + return AsNode(parent)->IndexOfChild(AsNode(child)); + } + virtual TreeModelNode* GetParent(TreeModelNode* node) { DCHECK(node); return AsNode(node)->GetParent(); |