| // Copyright 2015 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.ui.viewsv1; |
| |
| using fuchsia.sys; |
| using fuchsia.ui.viewsv1token; |
| |
| // Provides a View upon request. |
| // |
| // Applications should implement and expose this service so that they can |
| // expose views to be embedded into other applications. |
| [Discoverable] |
| protocol ViewProvider { |
| // Creates and registers a view with the view manager and returns its |
| // view owner which may subsequently be passed to |View.AddChild()| |
| // to attach the view to a view hierarchy. |
| // |
| // Implementors of this interface are responsible for creating the view |
| // and forwarding the |view_owner| interface request to |
| // |ViewManager.CreateView()|. |
| // |
| // The caller may request services from the created view via the |services| |
| // service provider. |
| CreateView(request<fuchsia.ui.viewsv1token.ViewOwner> view_owner, |
| request<fuchsia.sys.ServiceProvider>? services); |
| }; |