| 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/gfx/composition/interfaces/renderers.mojom"; |
| 9 import "mojo/services/ui/views/interfaces/layouts.mojom"; | 10 import "mojo/services/ui/views/interfaces/layouts.mojom"; |
| 10 import "mojo/services/ui/views/interfaces/views.mojom"; | 11 import "mojo/services/ui/views/interfaces/views.mojom"; |
| 11 | 12 |
| 12 // A view tree token is an opaque transferable reference to a view tree. | 13 // A view tree token is an opaque transferable reference to a view tree. |
| 13 // | 14 // |
| 14 // The ViewManager provides each view tree with a unique view tree token when | 15 // The ViewManager provides each view tree with a unique view tree token when |
| 15 // it is registered. The token can subsequently be passed to other | 16 // it is registered. The token can subsequently be passed to other |
| 16 // applications and used as a way to refer to the tree. | 17 // applications and used as a way to refer to the tree. |
| 17 // | 18 // |
| 18 // View tree tokens should be kept secret and should only be shared with | 19 // View tree tokens should be kept secret and should only be shared with |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 GetToken() => (ViewTreeToken token); | 67 GetToken() => (ViewTreeToken token); |
| 67 | 68 |
| 68 // Gets a service provider to access services which are associated with | 69 // Gets a service provider to access services which are associated with |
| 69 // the view tree such as input, accessibility and editing capabilities. | 70 // the view tree such as input, accessibility and editing capabilities. |
| 70 // The view tree service provider is private to the view tree and should | 71 // The view tree service provider is private to the view tree and should |
| 71 // not be shared with anyone else. | 72 // not be shared with anyone else. |
| 72 // | 73 // |
| 73 // See |mojo.ui.InputDispatcher|. | 74 // See |mojo.ui.InputDispatcher|. |
| 74 GetServiceProvider(mojo.ServiceProvider& service_provider); | 75 GetServiceProvider(mojo.ServiceProvider& service_provider); |
| 75 | 76 |
| 77 // Sets where the view tree's scene graph will be rendered. |
| 78 // |
| 79 // If |renderer| is null, disconnects the view tree from the renderer |
| 80 // causing its previous renderer to be destroyed. |
| 81 // |
| 82 // See also: |mojo.gfx.composition.Compositor.CreateRenderer()|. |
| 83 SetRenderer(mojo.gfx.composition.Renderer? renderer); |
| 84 |
| 76 // Requests that the view tree's OnLayout() method be called to compute a | 85 // Requests that the view tree's OnLayout() method be called to compute a |
| 77 // new layout due to a change in the view tree's layout information. | 86 // new layout due to a change in the view tree's layout information. |
| 78 RequestLayout(); | 87 RequestLayout(); |
| 79 | 88 |
| 80 // Sets the root of the view tree and assigns it the provided |root_key| | 89 // Sets the root of the view tree and assigns it the provided |root_key| |
| 81 // to distinguish it from any other roots this view tree has had. | 90 // to distinguish it from any other roots this view tree has had. |
| 82 // | 91 // |
| 83 // It is a good idea to provide a distinct |root_key| each time a new root | 92 // It is a good idea to provide a distinct |root_key| each time a new root |
| 84 // is set so that callbacks related to the root can be clearly distinguished | 93 // is set so that callbacks related to the root can be clearly distinguished |
| 85 // across these changes. | 94 // across these changes. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 155 |
| 147 // Called when the root view has become unavailable. | 156 // Called when the root view has become unavailable. |
| 148 // | 157 // |
| 149 // The root may become unavailable for many reasons such being unregistered | 158 // The root may become unavailable for many reasons such being unregistered |
| 150 // by its application, abnormal termination of its application, or | 159 // by its application, abnormal termination of its application, or |
| 151 // being reparented into a different view tree. | 160 // being reparented into a different view tree. |
| 152 // | 161 // |
| 153 // The implementation should invoke the callback once the event has | 162 // The implementation should invoke the callback once the event has |
| 154 // been handled. | 163 // been handled. |
| 155 OnRootUnavailable(uint32 root_key) => (); | 164 OnRootUnavailable(uint32 root_key) => (); |
| 165 |
| 166 // Called when the tree's renderer connection closed unexpectedly. |
| 167 // |
| 168 // The implementation should invoke the callback once the event has |
| 169 // been handled. |
| 170 OnRendererDied() => (); |
| 156 }; | 171 }; |
| OLD | NEW |