| 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/scenes.mojom"; | 9 import "mojo/services/gfx/composition/interfaces/scenes.mojom"; |
| 10 import "mojo/services/ui/views/interfaces/layouts.mojom"; | 10 import "mojo/services/ui/views/interfaces/layouts.mojom"; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // | 187 // |
| 188 // The returned |info| is null if this layout request was canceled either | 188 // The returned |info| is null if this layout request was canceled either |
| 189 // because it has been superceded by a subsequently issued layout request | 189 // because it has been superceded by a subsequently issued layout request |
| 190 // or because the child has become unavailable. | 190 // or because the child has become unavailable. |
| 191 // | 191 // |
| 192 // It is an error to specify a |child_key| that does not appear in | 192 // It is an error to specify a |child_key| that does not appear in |
| 193 // the parent's list of children; the connection will be closed. | 193 // the parent's list of children; the connection will be closed. |
| 194 // | 194 // |
| 195 // It is an error to specify malformed |child_layout_params| such | 195 // It is an error to specify malformed |child_layout_params| such |
| 196 // as invalid size constraints; the connection will be closed. | 196 // as invalid size constraints; the connection will be closed. |
| 197 LayoutChild(uint32 child_key, mojo.ui.ViewLayoutParams child_layout_params) | 197 LayoutChild(uint32 child_key, mojo.ui.ViewLayoutParams child_layout_params) =>
(mojo.ui.ViewLayoutInfo? info); |
| 198 => (mojo.ui.ViewLayoutInfo? info); | |
| 199 }; | 198 }; |
| 200 | 199 |
| 201 // An interface clients may implement to receive events from a view. | 200 // An interface clients may implement to receive events from a view. |
| 202 interface ViewListener { | 201 interface ViewListener { |
| 203 // Called when the view needs to update its layout and provide its size. | 202 // Called when the view needs to update its layout and provide its size. |
| 204 // | 203 // |
| 205 // This method may be called for one or more of the following reasons: | 204 // This method may be called for one or more of the following reasons: |
| 206 // | 205 // |
| 207 // 1. The view called RequestLayout() to mark itself as needing layout. | 206 // 1. The view called RequestLayout() to mark itself as needing layout. |
| 208 // 2. The view's parent called LayoutChild() for the first time to | 207 // 2. The view's parent called LayoutChild() for the first time to |
| (...skipping 24 matching lines...) Expand all Loading... |
| 233 // and will be informed that this child needs layout. | 232 // and will be informed that this child needs layout. |
| 234 // | 233 // |
| 235 // Recursive layout happens in any of the following circumstances: | 234 // Recursive layout happens in any of the following circumstances: |
| 236 // | 235 // |
| 237 // 1. If the resulting scene has changed since the last layout. | 236 // 1. If the resulting scene has changed since the last layout. |
| 238 // 2. If the resulting size has changed since the last layout. | 237 // 2. If the resulting size has changed since the last layout. |
| 239 // | 238 // |
| 240 // It is an error to return a malformed |result| which does not satisfy | 239 // It is an error to return a malformed |result| which does not satisfy |
| 241 // the requested |layout_params|, such as by returning a size which | 240 // the requested |layout_params|, such as by returning a size which |
| 242 // exceeds the requested constraints; the view's connection will be closed. | 241 // exceeds the requested constraints; the view's connection will be closed. |
| 243 OnLayout(mojo.ui.ViewLayoutParams layout_params, | 242 OnLayout(mojo.ui.ViewLayoutParams layout_params, array<uint32> children_needin
g_layout) => (mojo.ui.ViewLayoutResult result); |
| 244 array<uint32> children_needing_layout) => (mojo.ui.ViewLayoutResult result); | |
| 245 | 243 |
| 246 // Called when a child view has become unavailable. | 244 // Called when a child view has become unavailable. |
| 247 // | 245 // |
| 248 // A child may become unavailable for many reasons such being unregistered | 246 // A child may become unavailable for many reasons such being unregistered |
| 249 // by its application, abnormal termination of its application, or | 247 // by its application, abnormal termination of its application, or |
| 250 // cycles being introduced in the view tree. | 248 // cycles being introduced in the view tree. |
| 251 // | 249 // |
| 252 // To complete removal of an unavailable child, this view component must | 250 // To complete removal of an unavailable child, this view component must |
| 253 // call RemoveChild() on its view with |child_key|. | 251 // call RemoveChild() on its view with |child_key|. |
| 254 // | 252 // |
| 255 // The implementation should invoke the callback once the event has | 253 // The implementation should invoke the callback once the event has |
| 256 // been handled. | 254 // been handled. |
| 257 OnChildUnavailable(uint32 child_key) => (); | 255 OnChildUnavailable(uint32 child_key) => (); |
| 258 }; | 256 }; |
| OLD | NEW |