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

Side by Side Diff: app/tree_node_model.h

Issue 3111024: Remove wstrings from bookmarks, part 9. (Closed)
Patch Set: Created 10 years, 4 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 | « app/tree_model.h ('k') | app/tree_node_model_unittest.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 APP_TREE_NODE_MODEL_H_ 5 #ifndef APP_TREE_NODE_MODEL_H_
6 #define APP_TREE_NODE_MODEL_H_ 6 #define APP_TREE_NODE_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 DCHECK(node); 266 DCHECK(node);
267 return AsNode(node)->GetParent(); 267 return AsNode(node)->GetParent();
268 } 268 }
269 269
270 NodeType* AsNode(TreeModelNode* model_node) { 270 NodeType* AsNode(TreeModelNode* model_node) {
271 return static_cast<NodeType*>(model_node); 271 return static_cast<NodeType*>(model_node);
272 } 272 }
273 273
274 // Sets the title of the specified node. 274 // Sets the title of the specified node.
275 virtual void SetTitle(TreeModelNode* node, 275 virtual void SetTitle(TreeModelNode* node,
276 const std::wstring& title) { 276 const string16& title) {
277 DCHECK(node); 277 DCHECK(node);
278 AsNode(node)->SetTitle(WideToUTF16Hack(title)); 278 AsNode(node)->SetTitle(title);
279 NotifyObserverTreeNodeChanged(node); 279 NotifyObserverTreeNodeChanged(node);
280 } 280 }
281 281
282 void Add(NodeType* parent, int index, NodeType* child) { 282 void Add(NodeType* parent, int index, NodeType* child) {
283 DCHECK(parent && child); 283 DCHECK(parent && child);
284 parent->Add(index, child); 284 parent->Add(index, child);
285 NotifyObserverTreeNodesAdded(parent, index, 1); 285 NotifyObserverTreeNodesAdded(parent, index, 1);
286 } 286 }
287 287
288 NodeType* Remove(NodeType* parent, int index) { 288 NodeType* Remove(NodeType* parent, int index) {
(...skipping 27 matching lines...) Expand all
316 private: 316 private:
317 // The observers. 317 // The observers.
318 ObserverList<TreeModelObserver> observer_list_; 318 ObserverList<TreeModelObserver> observer_list_;
319 // The root. 319 // The root.
320 scoped_ptr<NodeType> root_; 320 scoped_ptr<NodeType> root_;
321 321
322 DISALLOW_COPY_AND_ASSIGN(TreeNodeModel); 322 DISALLOW_COPY_AND_ASSIGN(TreeNodeModel);
323 }; 323 };
324 324
325 #endif // APP_TREE_NODE_MODEL_H_ 325 #endif // APP_TREE_NODE_MODEL_H_
OLDNEW
« no previous file with comments | « app/tree_model.h ('k') | app/tree_node_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698