| 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/scene_token.mojom"; |
| 9 import "mojo/services/ui/views/interfaces/views.mojom"; | 10 import "mojo/services/ui/views/interfaces/views.mojom"; |
| 10 import "mojo/services/ui/views/interfaces/view_trees.mojom"; | 11 import "mojo/services/ui/views/interfaces/view_trees.mojom"; |
| 11 | 12 |
| 12 // View associates are trusted components that are attached to a view manager | 13 // View associates are trusted components that are attached to a view manager |
| 13 // instance with the purpose of offering additional services to views and | 14 // instance with the purpose of offering additional services to views and |
| 14 // view trees registered beyond the basic operations performed by the | 15 // view trees registered beyond the basic operations performed by the |
| 15 // view manager itself. Associates may be used to implement input, | 16 // view manager itself. Associates may be used to implement input, |
| 16 // accessibility, editing, and other capabilities. | 17 // accessibility, editing, and other capabilities. |
| 17 // | 18 // |
| 18 // Associates are coupled to a view manager instance for the entire life | 19 // Associates are coupled to a view manager instance for the entire life |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 array<string>? view_service_names; | 69 array<string>? view_service_names; |
| 69 | 70 |
| 70 // The names of view tree services offered by the associate. | 71 // The names of view tree services offered by the associate. |
| 71 // May be null if none. | 72 // May be null if none. |
| 72 array<string>? view_tree_service_names; | 73 array<string>? view_tree_service_names; |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 // Provides a view associate with the ability to inspect and perform operations | 76 // Provides a view associate with the ability to inspect and perform operations |
| 76 // on the contents of views and view trees. | 77 // on the contents of views and view trees. |
| 77 interface ViewInspector { | 78 interface ViewInspector { |
| 79 // Provides an interface which can be used to perform hit tests on the |
| 80 // contents of the view tree's scene graph. |
| 81 // |
| 82 // The |hit_tester| will be closed if the view tree is not attached to a |
| 83 // renderer, when it is reattached to a different renderer, or when the |
| 84 // view tree is destroyed. |
| 85 // |
| 86 // The callback will be invoked the hit tester is invalidated. |
| 87 // If |renderer_changed| is true, the client should call |GetHitTester| |
| 88 // again to obtain a new one. Otherwise it should assume that the view |
| 89 // tree has become unavailable (so no hit tester is available). |
| 90 GetHitTester(ViewTreeToken view_tree_token, |
| 91 mojo.gfx.composition.HitTester& hit_tester) => |
| 92 (bool renderer_changed); |
| 78 | 93 |
| 94 // Given an array of scene tokens, produces an array of view tokens |
| 95 // of equal size containing the view to which the scene belongs or null |
| 96 // if the scene token does not belong to any view. |
| 97 // |
| 98 // It is safe to cache the results of this operation because a scene will |
| 99 // only ever be associated with at most one view although a view may |
| 100 // create several scenes during its lifetime. |
| 101 ResolveScenes(array<mojo.gfx.composition.SceneToken> scene_tokens) => |
| 102 (array<ViewToken?> view_tokens); |
| 79 }; | 103 }; |
| OLD | NEW |