OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 bool IsDrawn() const; | 96 bool IsDrawn() const; |
97 | 97 |
98 // Observation. | 98 // Observation. |
99 void AddObserver(ViewObserver* observer); | 99 void AddObserver(ViewObserver* observer); |
100 void RemoveObserver(ViewObserver* observer); | 100 void RemoveObserver(ViewObserver* observer); |
101 | 101 |
102 // Tree. | 102 // Tree. |
103 View* parent() { return parent_; } | 103 View* parent() { return parent_; } |
104 const View* parent() const { return parent_; } | 104 const View* parent() const { return parent_; } |
105 const Children& children() const { return children_; } | 105 const Children& children() const { return children_; } |
| 106 View* GetRoot() { |
| 107 return const_cast<View*>(const_cast<const View*>(this)->GetRoot()); |
| 108 } |
106 const View* GetRoot() const; | 109 const View* GetRoot() const; |
107 | 110 |
108 void AddChild(View* child); | 111 void AddChild(View* child); |
109 void RemoveChild(View* child); | 112 void RemoveChild(View* child); |
110 | 113 |
111 void Reorder(View* relative, OrderDirection direction); | 114 void Reorder(View* relative, OrderDirection direction); |
112 void MoveToFront(); | 115 void MoveToFront(); |
113 void MoveToBack(); | 116 void MoveToBack(); |
114 | 117 |
115 bool Contains(View* child) const; | 118 bool Contains(View* child) const; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 }; | 196 }; |
194 | 197 |
195 std::map<const void*, Value> prop_map_; | 198 std::map<const void*, Value> prop_map_; |
196 | 199 |
197 DISALLOW_COPY_AND_ASSIGN(View); | 200 DISALLOW_COPY_AND_ASSIGN(View); |
198 }; | 201 }; |
199 | 202 |
200 } // namespace mojo | 203 } // namespace mojo |
201 | 204 |
202 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ | 205 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ |
OLD | NEW |