summaryrefslogtreecommitdiffstats
path: root/chrome/views/tree_view.h
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 04:44:35 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 04:44:35 +0000
commit6e863adaeafffd8fa5f2c6c733c22d9fc0ee17e7 (patch)
tree4ed828099735d977dd9aff9e5b70a58f3c83ffb7 /chrome/views/tree_view.h
parent1db308f6dff751da5f7b88258966f8c1ad4c1774 (diff)
downloadchromium_src-6e863adaeafffd8fa5f2c6c733c22d9fc0ee17e7.zip
chromium_src-6e863adaeafffd8fa5f2c6c733c22d9fc0ee17e7.tar.gz
chromium_src-6e863adaeafffd8fa5f2c6c733c22d9fc0ee17e7.tar.bz2
Adds support for models to provide addition icons to the tree. Updates
the bookmarks folder tree model to return custom icons for search and recently bookmarked. BUG=674 TEST=none Review URL: http://codereview.chromium.org/9047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/tree_view.h')
-rw-r--r--chrome/views/tree_view.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/views/tree_view.h b/chrome/views/tree_view.h
index a219f52..fb3f50e 100644
--- a/chrome/views/tree_view.h
+++ b/chrome/views/tree_view.h
@@ -72,6 +72,15 @@ class TreeModel {
const std::wstring& title) {
NOTREACHED();
}
+
+ // Returns the set of icons for the nodes in the tree. You only need override
+ // this if you don't want to use the default folder icons.
+ virtual void GetIcons(std::vector<SkBitmap>* icons) {}
+
+ // Returns the index of the icon to use for |node|. Return -1 to use the
+ // default icon. The index is relative to the list of icons returned from
+ // GetIcons.
+ virtual int GetIconIndex(TreeModelNode* node) { return -1; }
};
// TreeViewController ---------------------------------------------------------
@@ -284,6 +293,9 @@ class TreeView : public NativeControl, TreeModelObserver {
// Returns the NodeDetails by HTREEITEM.
NodeDetails* GetNodeDetailsByTreeItem(HTREEITEM tree_item);
+ // Creates the image list to use for the tree.
+ HIMAGELIST CreateImageList();
+
// The window function installed on the treeview.
static LRESULT CALLBACK TreeWndProc(HWND window,
UINT message,
@@ -335,6 +347,11 @@ class TreeView : public NativeControl, TreeModelObserver {
bool drag_enabled_;
+ // Did the model return a non-empty set of icons from GetIcons?
+ bool has_custom_icons_;
+
+ HIMAGELIST image_list_;
+
DISALLOW_COPY_AND_ASSIGN(TreeView);
};