| Index: mojo/services/view_manager/public/cpp/lib/view.cc
|
| diff --git a/mojo/services/view_manager/public/cpp/lib/view.cc b/mojo/services/view_manager/public/cpp/lib/view.cc
|
| index ee645055bd5f4db2e665a1e5f367aa55e9aa7534..6e82802d08d323afd35a3c14d9b249bcd8b65a1f 100644
|
| --- a/mojo/services/view_manager/public/cpp/lib/view.cc
|
| +++ b/mojo/services/view_manager/public/cpp/lib/view.cc
|
| @@ -273,6 +273,13 @@ void View::RemoveObserver(ViewObserver* observer) {
|
| observers_.RemoveObserver(observer);
|
| }
|
|
|
| +View* View::GetRoot() {
|
| + View* root = this;
|
| + for (View* parent = this; parent; parent = parent->parent())
|
| + root = parent;
|
| + return root;
|
| +}
|
| +
|
| const View* View::GetRoot() const {
|
| const View* root = this;
|
| for (const View* parent = this; parent; parent = parent->parent())
|
|
|