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

Unified Diff: mojo/services/view_manager/public/cpp/lib/view.cc

Issue 805123003: Adds capture to the mojo window_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Cleanup Created 6 years 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 side-by-side diff with in-line comments
Download patch
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())

Powered by Google App Engine
This is Rietveld 408576698