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

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

Issue 7171001: ui/base/models: Fix the API example code comment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 20 matching lines...) Expand all
31 // yourself any time you make any change directly to the TreeNodes. For example, 31 // yourself any time you make any change directly to the TreeNodes. For example,
32 // if you directly invoke set_title on a node it does not notify the observer, 32 // if you directly invoke set_title on a node it does not notify the observer,
33 // you will need to do it yourself. This includes the following methods: Add, 33 // you will need to do it yourself. This includes the following methods: Add,
34 // Remove and set_title. TreeNodeModel provides cover methods that mutate the 34 // Remove and set_title. TreeNodeModel provides cover methods that mutate the
35 // TreeNodes and notify the observer. If you are using TreeNodes with a 35 // TreeNodes and notify the observer. If you are using TreeNodes with a
36 // TreeNodeModel use the cover methods to save yourself the headache. 36 // TreeNodeModel use the cover methods to save yourself the headache.
37 // 37 //
38 // The following example creates a TreeNode with two children and then 38 // The following example creates a TreeNode with two children and then
39 // creates a TreeNodeModel from it: 39 // creates a TreeNodeModel from it:
40 // 40 //
41 // TreeNodeWithValue<int> root; 41 // TreeNodeWithValue<int>* root = new TreeNodeWithValue<int>();
42 // root.Add(new TreeNodeWithValue<int>(ASCIIToUTF16("child 1"), 0)); 42 // root->Add(new TreeNodeWithValue<int>(ASCIIToUTF16("child 1"), 0));
43 // root.Add(new TreeNodeWithValue<int>(ASCIIToUTF16("child 2"), 1)); 43 // root->Add(new TreeNodeWithValue<int>(ASCIIToUTF16("child 2"), 1));
44 // TreeNodeModel<TreeNodeWithValue<int> > model(&root); 44 // TreeNodeModel<TreeNodeWithValue<int> > model(root);
45 // 45 //
46 // Two variants of TreeNode are provided here: 46 // Two variants of TreeNode are provided here:
47 // 47 //
48 // . TreeNode itself is intended for subclassing. It has one type parameter 48 // . TreeNode itself is intended for subclassing. It has one type parameter
49 // that corresponds to the type of the node. When subclassing use your class 49 // that corresponds to the type of the node. When subclassing use your class
50 // name as the type parameter, eg: 50 // name as the type parameter, eg:
51 // class MyTreeNode : public TreeNode<MyTreeNode> . 51 // class MyTreeNode : public TreeNode<MyTreeNode> .
52 // . TreeNodeWithValue is a trivial subclass of TreeNode that has one type 52 // . TreeNodeWithValue is a trivial subclass of TreeNode that has one type
53 // type parameter: a value type that is associated with the node. 53 // type parameter: a value type that is associated with the node.
54 // 54 //
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 // The root. 290 // The root.
291 scoped_ptr<NodeType> root_; 291 scoped_ptr<NodeType> root_;
292 292
293 DISALLOW_COPY_AND_ASSIGN(TreeNodeModel); 293 DISALLOW_COPY_AND_ASSIGN(TreeNodeModel);
294 }; 294 };
295 295
296 } // namespace ui 296 } // namespace ui
297 297
298 #endif // UI_BASE_MODELS_TREE_NODE_MODEL_H_ 298 #endif // UI_BASE_MODELS_TREE_NODE_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698