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

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

Issue 737913002: Dispatch key events to the currently focused window. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Redo FocusController storage so that it is a local property on a view. Created 6 years, 1 month 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
« no previous file with comments | « examples/wm_flow/wm/wm.cc ('k') | mojo/services/public/cpp/view_manager/view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/public/cpp/view_manager/lib/view.cc
diff --git a/mojo/services/public/cpp/view_manager/lib/view.cc b/mojo/services/public/cpp/view_manager/lib/view.cc
index bedac6b67b6bea406fb55d0288a3bec5f9295e67..4dc45227fcb36139a692e624b5728fd8cec934e3 100644
--- a/mojo/services/public/cpp/view_manager/lib/view.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view.cc
@@ -270,6 +270,13 @@ void View::RemoveObserver(ViewObserver* observer) {
observers_.RemoveObserver(observer);
}
+const View* View::GetRoot() const {
+ const View* root = this;
+ for (const View* parent = this; parent; parent = parent->parent())
+ root = parent;
+ return root;
+}
+
void View::AddChild(View* child) {
// TODO(beng): not necessarily valid to all connections, but possibly to the
// embeddee in an embedder-embeddee relationship.
« no previous file with comments | « examples/wm_flow/wm/wm.cc ('k') | mojo/services/public/cpp/view_manager/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698