[scenic] ViewHost now uses eventpairs
TEST: set_root_view perspective; Ran SysUI
SCN-897 #comment
SCN-1033 #comment
Change-Id: I847717853b10719951ab6051d39988df360d6bdb
diff --git a/lib/fidl/view_host.cc b/lib/fidl/view_host.cc
index 5ff24d5..351ca08 100644
--- a/lib/fidl/view_host.cc
+++ b/lib/fidl/view_host.cc
@@ -23,8 +23,7 @@
ViewHost::~ViewHost() = default;
-void ViewHost::ConnectView(
- fidl::InterfaceHandle<fuchsia::ui::viewsv1token::ViewOwner> view_owner) {
+void ViewHost::ConnectView(zx::eventpair view_holder_token) {
const uint32_t child_key = next_child_key_++;
auto view_data = std::make_unique<ViewData>(session());
@@ -34,12 +33,16 @@
container_node_.AddChild(view_data->host_node);
views_.emplace(child_key, std::move(view_data));
- GetViewContainer()->AddChild2(
- child_key, zx::eventpair(view_owner.TakeChannel().release()),
- std::move(host_import_token));
+ GetViewContainer()->AddChild2(child_key, std::move(view_holder_token),
+ std::move(host_import_token));
UpdateScene();
}
+void ViewHost::ConnectView(
+ fidl::InterfaceHandle<fuchsia::ui::viewsv1token::ViewOwner> view_owner) {
+ ConnectView(zx::eventpair(view_owner.TakeChannel().release()));
+}
+
void ViewHost::OnPropertiesChanged(
fuchsia::ui::viewsv1::ViewProperties /*old_properties*/) {
UpdateScene();
diff --git a/lib/fidl/view_host.h b/lib/fidl/view_host.h
index 399e8be..a4c0155 100644
--- a/lib/fidl/view_host.h
+++ b/lib/fidl/view_host.h
@@ -30,6 +30,7 @@
// multiple views and lays them out horizontally next to each other.
// This is experimental to establish data flow patterns in toy
// applications and can be changed or extended as needed.
+ void ConnectView(zx::eventpair view_holder_token);
void ConnectView(
fidl::InterfaceHandle<fuchsia::ui::viewsv1token::ViewOwner> view_owner);