summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 04:31:35 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 04:31:35 +0000
commitb504899244b4264994d4daae2bee660706dba652 (patch)
treeeda190cb35dfff7f700a4c636730ff2487cb35d8 /chrome/views
parente562de106eeab2667eeb6922ddf2d771a0efa55d (diff)
downloadchromium_src-b504899244b4264994d4daae2bee660706dba652.zip
chromium_src-b504899244b4264994d4daae2bee660706dba652.tar.gz
chromium_src-b504899244b4264994d4daae2bee660706dba652.tar.bz2
Adds import/export of bookmarks to bookmarks.html file.
BUG=1649 TEST=bring up bookmark manager and try out import/export from the tools menu. Note that import ALWAYS creates a new folder under the 'Other bookmarks folder' with the name of Imported (x). This is by design. Review URL: http://codereview.chromium.org/9471 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4968 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/tree_view.cc24
-rw-r--r--chrome/views/tree_view.h8
2 files changed, 16 insertions, 16 deletions
diff --git a/chrome/views/tree_view.cc b/chrome/views/tree_view.cc
index 8987042..913b845 100644
--- a/chrome/views/tree_view.cc
+++ b/chrome/views/tree_view.cc
@@ -157,6 +157,18 @@ void TreeView::ExpandAll() {
ExpandAll(model_->GetRoot());
}
+void TreeView::ExpandAll(TreeModelNode* node) {
+ DCHECK(node);
+ // Expand the node.
+ if (node != model_->GetRoot() || root_shown_)
+ TreeView_Expand(tree_view_, GetNodeDetails(node)->tree_item, TVE_EXPAND);
+ // And recursively expand all the children.
+ for (int i = model_->GetChildCount(node) - 1; i >= 0; --i) {
+ TreeModelNode* child = model_->GetChild(node, i);
+ ExpandAll(child);
+ }
+}
+
bool TreeView::IsExpanded(TreeModelNode* node) {
TreeModelNode* parent = model_->GetParent(node);
if (!parent)
@@ -470,18 +482,6 @@ HTREEITEM TreeView::GetTreeItemForNode(TreeModelNode* node) {
return details ? details->tree_item : NULL;
}
-void TreeView::ExpandAll(TreeModelNode* node) {
- DCHECK(node);
- // Expand the node.
- if (node != model_->GetRoot() || root_shown_)
- TreeView_Expand(tree_view_, GetNodeDetails(node)->tree_item, TVE_EXPAND);
- // And recursively expand all the children.
- for (int i = model_->GetChildCount(node) - 1; i >= 0; --i) {
- TreeModelNode* child = model_->GetChild(node, i);
- ExpandAll(child);
- }
-}
-
void TreeView::DeleteRootItems() {
HTREEITEM root = TreeView_GetRoot(tree_view_);
if (root) {
diff --git a/chrome/views/tree_view.h b/chrome/views/tree_view.h
index fb3f50e..d0d083e 100644
--- a/chrome/views/tree_view.h
+++ b/chrome/views/tree_view.h
@@ -147,6 +147,10 @@ class TreeView : public NativeControl, TreeModelObserver {
// Convenience to expand ALL nodes in the tree.
void ExpandAll();
+ // Invoked from ExpandAll(). Expands the supplied node and recursively
+ // invokes itself with all children.
+ void ExpandAll(TreeModelNode* node);
+
// Returns true if the specified node is expanded.
bool IsExpanded(TreeModelNode* node);
@@ -253,10 +257,6 @@ class TreeView : public NativeControl, TreeModelObserver {
bool loaded_children;
};
- // Invoked from ExpandAll(). Expands the supplied node and recursively
- // invokes itself with all children.
- void ExpandAll(TreeModelNode* node);
-
// Deletes the root items from the treeview. This is used when the model
// changes.
void DeleteRootItems();