Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(931)

Side by Side Diff: ui/base/models/tree_node_model.h

Issue 253753005: Move bookmarks' production code to components/bookmarks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@367656
Patch Set: Fix compilation for win_chromium_x64_rel Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/bookmarks/core/browser/scoped_group_bookmark_actions.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_MODELS_TREE_NODE_MODEL_H_ 5 #ifndef UI_BASE_MODELS_TREE_NODE_MODEL_H_
6 #define UI_BASE_MODELS_TREE_NODE_MODEL_H_ 6 #define UI_BASE_MODELS_TREE_NODE_MODEL_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 for (size_t i = 0; i < children_.size(); ++i) 99 for (size_t i = 0; i < children_.size(); ++i)
100 children_[i]->parent_ = NULL; 100 children_[i]->parent_ = NULL;
101 children_.weak_clear(); 101 children_.weak_clear();
102 } 102 }
103 103
104 // Removes all existing children without deleting the nodes and adds all nodes 104 // Removes all existing children without deleting the nodes and adds all nodes
105 // contained in |children| into this node as children. 105 // contained in |children| into this node as children.
106 void SetChildren(const std::vector<NodeType*>& children) { 106 void SetChildren(const std::vector<NodeType*>& children) {
107 RemoveAll(); 107 RemoveAll();
108 for (size_t i = 0; i < children.size(); ++i) 108 for (size_t i = 0; i < children.size(); ++i)
109 Add(children[i], i); 109 Add(children[i], static_cast<int>(i));
110 } 110 }
111 111
112 // Returns the parent node, or NULL if this is the root node. 112 // Returns the parent node, or NULL if this is the root node.
113 const NodeType* parent() const { return parent_; } 113 const NodeType* parent() const { return parent_; }
114 NodeType* parent() { return parent_; } 114 NodeType* parent() { return parent_; }
115 115
116 // Returns true if this is the root node. 116 // Returns true if this is the root node.
117 bool is_root() const { return parent_ == NULL; } 117 bool is_root() const { return parent_ == NULL; }
118 118
119 // Returns the number of children. 119 // Returns the number of children.
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 // The root. 297 // The root.
298 scoped_ptr<NodeType> root_; 298 scoped_ptr<NodeType> root_;
299 299
300 DISALLOW_COPY_AND_ASSIGN(TreeNodeModel); 300 DISALLOW_COPY_AND_ASSIGN(TreeNodeModel);
301 }; 301 };
302 302
303 } // namespace ui 303 } // namespace ui
304 304
305 #endif // UI_BASE_MODELS_TREE_NODE_MODEL_H_ 305 #endif // UI_BASE_MODELS_TREE_NODE_MODEL_H_
OLDNEW
« no previous file with comments | « components/bookmarks/core/browser/scoped_group_bookmark_actions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698