| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
| 6 module mojo.ui; | 6 module mojo.ui; |
| 7 | 7 |
| 8 import "mojo/public/interfaces/application/service_provider.mojom"; | 8 import "mojo/public/interfaces/application/service_provider.mojom"; |
| 9 import "mojo/services/ui/views/interfaces/views.mojom"; | 9 import "mojo/services/ui/views/interfaces/views.mojom"; |
| 10 | 10 |
| 11 // Provides a View upon request. | 11 // Provides a View upon request. |
| 12 // | 12 // |
| 13 // Applications should implement and expose this service so that they can | 13 // Applications should implement and expose this service so that they can |
| 14 // expose views to be embedded into other applications. | 14 // expose views to be embedded into other applications. |
| 15 [ServiceName="mojo::ui::ViewProvider"] |
| 15 interface ViewProvider { | 16 interface ViewProvider { |
| 16 // Creates and registers a view with the view manager and returns its | 17 // Creates and registers a view with the view manager and returns its |
| 17 // view token (as provided by |ViewManager.RegisterView()|). | 18 // view token (as provided by |ViewManager.RegisterView()|). |
| 18 // | 19 // |
| 19 // Having received the view token, the caller should attach the view to | 20 // Having received the view token, the caller should attach the view to |
| 20 // a view tree and lay it out. | 21 // a view tree and lay it out. |
| 21 // | 22 // |
| 22 // The caller may provide services to the view via the |services| | 23 // The caller may provide services to the view via the |services| |
| 23 // service provider. | 24 // service provider. |
| 24 // | 25 // |
| 25 // The caller may receive services from the view via the |exposed_services| | 26 // The caller may receive services from the view via the |exposed_services| |
| 26 // service provider. | 27 // service provider. |
| 27 CreateView(mojo.ServiceProvider&? services, | 28 CreateView(mojo.ServiceProvider&? services, |
| 28 mojo.ServiceProvider? exposed_services) => | 29 mojo.ServiceProvider? exposed_services) => |
| 29 (ViewToken view_token); | 30 (ViewToken view_token); |
| 30 }; | 31 }; |
| OLD | NEW |