OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 module mojo; | 5 module mojo; |
6 | 6 |
| 7 import "components/view_manager/public/interfaces/compositor_frame.mojom"; |
7 import "components/view_manager/public/interfaces/surface_id.mojom"; | 8 import "components/view_manager/public/interfaces/surface_id.mojom"; |
8 import "components/view_manager/public/interfaces/view_manager_constants.mojom"; | 9 import "components/view_manager/public/interfaces/view_manager_constants.mojom"; |
9 import "mojo/application/public/interfaces/service_provider.mojom"; | 10 import "mojo/application/public/interfaces/service_provider.mojom"; |
10 import "network/public/interfaces/url_loader.mojom"; | 11 import "network/public/interfaces/url_loader.mojom"; |
11 import "ui/mojo/events/input_events.mojom"; | 12 import "ui/mojo/events/input_events.mojom"; |
12 import "ui/mojo/ime/text_input_state.mojom"; | 13 import "ui/mojo/ime/text_input_state.mojom"; |
13 import "ui/mojo/geometry/geometry.mojom"; | 14 import "ui/mojo/geometry/geometry.mojom"; |
14 | 15 |
15 struct ViewportMetrics { | 16 struct ViewportMetrics { |
16 Size size_in_pixels; | 17 Size size_in_pixels; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // allowed to change the visibility of any view they have created, as well as | 69 // allowed to change the visibility of any view they have created, as well as |
69 // any of their roots. | 70 // any of their roots. |
70 SetViewVisibility(uint32 view_id, bool visible) => (bool success); | 71 SetViewVisibility(uint32 view_id, bool visible) => (bool success); |
71 | 72 |
72 // Sets an individual named property. Setting an individual property to null | 73 // Sets an individual named property. Setting an individual property to null |
73 // deletes the property. | 74 // deletes the property. |
74 SetViewProperty(uint32 view_id, | 75 SetViewProperty(uint32 view_id, |
75 string name, | 76 string name, |
76 array<uint8>? value) => (bool success); | 77 array<uint8>? value) => (bool success); |
77 | 78 |
| 79 // Requests a Surface for a particular view. |
| 80 RequestSurface(uint32 view_id, Surface& surface, SurfaceClient client); |
| 81 |
78 // Reparents a view. | 82 // Reparents a view. |
79 // This fails for any of the following reasons: | 83 // This fails for any of the following reasons: |
80 // . |parent| or |child| does not identify a valid view. | 84 // . |parent| or |child| does not identify a valid view. |
81 // . |child| is an ancestor of |parent|. | 85 // . |child| is an ancestor of |parent|. |
82 // . |child| is already a child of |parent|. | 86 // . |child| is already a child of |parent|. |
83 // | 87 // |
84 // This may result in a connection getting OnViewDeleted(). See | 88 // This may result in a connection getting OnViewDeleted(). See |
85 // RemoveViewFromParent for details. | 89 // RemoveViewFromParent for details. |
86 AddView(uint32 parent, uint32 child) => (bool success); | 90 AddView(uint32 parent, uint32 child) => (bool success); |
87 | 91 |
(...skipping 14 matching lines...) Expand all Loading... |
102 ReorderView(uint32 view_id, | 106 ReorderView(uint32 view_id, |
103 uint32 relative_view_id, | 107 uint32 relative_view_id, |
104 OrderDirection direction) => (bool success); | 108 OrderDirection direction) => (bool success); |
105 | 109 |
106 // Returns the views comprising the tree starting at |view_id|. |view_id| is | 110 // Returns the views comprising the tree starting at |view_id|. |view_id| is |
107 // the first result in the return value, unless |view_id| is invalid, in which | 111 // the first result in the return value, unless |view_id| is invalid, in which |
108 // case an empty vector is returned. The views are visited using a depth first | 112 // case an empty vector is returned. The views are visited using a depth first |
109 // search (pre-order). | 113 // search (pre-order). |
110 GetViewTree(uint32 view_id) => (array<ViewData> views); | 114 GetViewTree(uint32 view_id) => (array<ViewData> views); |
111 | 115 |
112 // Shows the surface in the specified view. | |
113 SetViewSurfaceId(uint32 view_id, SurfaceId surface_id) => (bool success); | |
114 | |
115 // Tells the ViewTree that the ViewTreeClient wants to get | 116 // Tells the ViewTree that the ViewTreeClient wants to get |
116 // OnEmbedForDescendant() when EmbedAllowingReembed() is invoked on any | 117 // OnEmbedForDescendant() when EmbedAllowingReembed() is invoked on any |
117 // descendant Views. | 118 // descendant Views. |
118 // | 119 // |
119 // See Embed() docs for more details. | 120 // See Embed() docs for more details. |
120 // | 121 // |
121 // TODO(sky): this needs to be restricted in some way. Maybe the root can | 122 // TODO(sky): this needs to be restricted in some way. Maybe the root can |
122 // grant this ability? | 123 // grant this ability? |
123 SetEmbedRoot(); | 124 SetEmbedRoot(); |
124 | 125 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 238 |
238 // Invoked when a view property is changed. If this change is a removal, | 239 // Invoked when a view property is changed. If this change is a removal, |
239 // |new_data| is null. | 240 // |new_data| is null. |
240 OnViewSharedPropertyChanged(uint32 view, string name, array<uint8>? new_data); | 241 OnViewSharedPropertyChanged(uint32 view, string name, array<uint8>? new_data); |
241 | 242 |
242 // Invoked when an event is targeted at the specified view. | 243 // Invoked when an event is targeted at the specified view. |
243 OnViewInputEvent(uint32 view, mojo.Event event) => (); | 244 OnViewInputEvent(uint32 view, mojo.Event event) => (); |
244 | 245 |
245 OnViewFocused(uint32 focused_view_id); | 246 OnViewFocused(uint32 focused_view_id); |
246 }; | 247 }; |
OLD | NEW |