OLD | NEW |
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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <memory> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
19 #include "ui/base/models/tree_model.h" | 19 #include "ui/base/models/tree_model.h" |
20 | 20 |
21 namespace ui { | 21 namespace ui { |
22 | 22 |
23 // TreeNodeModel and TreeNodes provide an implementation of TreeModel around | 23 // TreeNodeModel and TreeNodes provide an implementation of TreeModel around |
24 // TreeNodes. | 24 // TreeNodes. |
25 // | 25 // |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 DCHECK(node); | 291 DCHECK(node); |
292 AsNode(node)->SetTitle(title); | 292 AsNode(node)->SetTitle(title); |
293 NotifyObserverTreeNodeChanged(node); | 293 NotifyObserverTreeNodeChanged(node); |
294 } | 294 } |
295 | 295 |
296 private: | 296 private: |
297 // The observers. | 297 // The observers. |
298 base::ObserverList<TreeModelObserver> observer_list_; | 298 base::ObserverList<TreeModelObserver> observer_list_; |
299 | 299 |
300 // The root. | 300 // The root. |
301 scoped_ptr<NodeType> root_; | 301 std::unique_ptr<NodeType> root_; |
302 | 302 |
303 DISALLOW_COPY_AND_ASSIGN(TreeNodeModel); | 303 DISALLOW_COPY_AND_ASSIGN(TreeNodeModel); |
304 }; | 304 }; |
305 | 305 |
306 } // namespace ui | 306 } // namespace ui |
307 | 307 |
308 #endif // UI_BASE_MODELS_TREE_NODE_MODEL_H_ | 308 #endif // UI_BASE_MODELS_TREE_NODE_MODEL_H_ |
OLD | NEW |