| Index: mojo/services/view_manager/node.cc
|
| diff --git a/mojo/services/view_manager/node.cc b/mojo/services/view_manager/node.cc
|
| index 49d9376b631022d4c930a44874f58aaa8cc0f5b0..21b3b5cab7daf937cdf1d22100c8ed9a7de1e3b9 100644
|
| --- a/mojo/services/view_manager/node.cc
|
| +++ b/mojo/services/view_manager/node.cc
|
| @@ -40,7 +40,7 @@ Node::~Node() {
|
| SetView(NULL);
|
| }
|
|
|
| -Node* Node::GetParent() {
|
| +const Node* Node::GetParent() const {
|
| if (!window_.parent())
|
| return NULL;
|
| return window_.parent()->GetProperty(kNodeKey);
|
| @@ -54,6 +54,13 @@ void Node::Remove(Node* child) {
|
| window_.RemoveChild(&child->window_);
|
| }
|
|
|
| +const Node* Node::GetRoot() const {
|
| + const aura::Window* window = &window_;
|
| + while (window && window->parent())
|
| + window = window->parent();
|
| + return window->GetProperty(kNodeKey);
|
| +}
|
| +
|
| std::vector<Node*> Node::GetChildren() {
|
| std::vector<Node*> children;
|
| children.reserve(window_.children().size());
|
| @@ -62,6 +69,10 @@ std::vector<Node*> Node::GetChildren() {
|
| return children;
|
| }
|
|
|
| +bool Node::Contains(const Node* node) const {
|
| + return node && window_.Contains(&(node->window_));
|
| +}
|
| +
|
| void Node::SetView(View* view) {
|
| if (view == view_)
|
| return;
|
|
|