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 "geometry/public/interfaces/geometry.mojom"; | 7 import "geometry/public/interfaces/geometry.mojom"; |
8 import "input_events/public/interfaces/input_events.mojom"; | 8 import "input_events/public/interfaces/input_events.mojom"; |
9 import "mojo/public/interfaces/application/service_provider.mojom"; | 9 import "mojo/public/interfaces/application/service_provider.mojom"; |
10 import "native_viewport/public/interfaces/native_viewport.mojom"; | 10 import "native_viewport/public/interfaces/native_viewport.mojom"; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 | 98 |
99 // Returns the views comprising the tree starting at |view_id|. |view_id| is | 99 // Returns the views comprising the tree starting at |view_id|. |view_id| is |
100 // the first result in the return value, unless |view_id| is invalid, in which | 100 // the first result in the return value, unless |view_id| is invalid, in which |
101 // case an empty vector is returned. The views are visited using a depth first | 101 // case an empty vector is returned. The views are visited using a depth first |
102 // search (pre-order). | 102 // search (pre-order). |
103 GetViewTree(uint32 view_id) => (array<ViewData> views); | 103 GetViewTree(uint32 view_id) => (array<ViewData> views); |
104 | 104 |
105 // Shows the surface in the specified view. | 105 // Shows the surface in the specified view. |
106 SetViewSurfaceId(uint32 view_id, SurfaceId surface_id) => (bool success); | 106 SetViewSurfaceId(uint32 view_id, SurfaceId surface_id) => (bool success); |
107 | 107 |
108 // Embeds the app for |url| in the specified view. More specifically this | 108 // A connection may grant access to a view from another connection by way of |
109 // creates a new connection to the specified url, expecting to get a | 109 // the embed functions. There are two variants of this call: |
110 // ViewManagerClient and configures it with the root view |view|. Fails | 110 // |
111 // if |view| was not created by this connection. | 111 // . EmbedUrl: the ViewManager connects to the app at the supplied url and |
112 // asks it for a ViewManagerClient. | |
113 // . With the second variant a ViewManagerClient is directly supplied. | |
114 // | |
115 // In both cases the new ViewManagerClient is configured with a root of | |
116 // |view_id|. The call fails if the originating connection did not create | |
hansmuller1
2015/02/09 20:46:44
I think you mean that the call returns (responds w
| |
117 // the view identified by |view_id|. | |
112 // | 118 // |
113 // A view may only be a root of one connection at a time. Subsequent calls to | 119 // A view may only be a root of one connection at a time. Subsequent calls to |
114 // Embed() for the same view result in the view being removed from the | 120 // Embed() for the same view result in the view being removed from the |
115 // currently embedded app. The embedded app is told this by way of | 121 // currently embedded app. The embedded app is told this by way of |
116 // OnViewDeleted(). | 122 // OnViewDeleted(). |
117 // | 123 // |
118 // The embedder can detect when the embedded app disconnects by way of | 124 // The embedder can detect when the embedded app disconnects by way of |
119 // OnEmbeddedAppDisconnected(). | 125 // OnEmbeddedAppDisconnected(). |
120 // | 126 // |
121 // When a connection embeds an app the connection no longer has priviledges | 127 // When a connection embeds an app the connection no longer has priviledges |
122 // to access or see any of the children of the view. If the view had existing | 128 // to access or see any of the children of the view. If the view had existing |
123 // children the children are removed. The one exception is the root | 129 // children the children are removed. The one exception is the root |
124 // connection. | 130 // connection. |
125 // | 131 // |
126 // |services| encapsulates services offered by the embedder to the embedded | 132 // |services| encapsulates services offered by the embedder to the embedded |
127 // app alongside this Embed() call. |exposed_services| provides a means for | 133 // app alongside this Embed() call. |exposed_services| provides a means for |
128 // the embedder to connect to services exposed by the embedded app. Note that | 134 // the embedder to connect to services exposed by the embedded app. Note that |
129 // if a different app is subsequently embedded at |view_id| the | 135 // if a different app is subsequently embedded at |view_id| the |
130 // ServiceProvider connections to its client in the embedded app and any | 136 // ServiceProvider connections to its client in the embedded app and any |
131 // services it provided are not broken and continue to be valid. | 137 // services it provided are not broken and continue to be valid. |
132 Embed(string url, | 138 EmbedUrl(string url, |
133 uint32 view_id, | 139 uint32 view_id, |
134 ServiceProvider&? services, | 140 ServiceProvider&? services, |
135 ServiceProvider? exposed_services) => (bool success); | 141 ServiceProvider? exposed_services) => (bool success); |
142 Embed(uint32 view_id, ViewManagerClient client) => (bool success); | |
136 }; | 143 }; |
137 | 144 |
138 // Changes to views are not sent to the connection that originated the | 145 // Changes to views are not sent to the connection that originated the |
139 // change. For example, if connection 1 changes the bounds of a view by calling | 146 // change. For example, if connection 1 changes the bounds of a view by calling |
140 // SetBounds(), connection 1 does not receive OnViewBoundsChanged(). | 147 // SetBounds(), connection 1 does not receive OnViewBoundsChanged(). |
141 interface ViewManagerClient { | 148 interface ViewManagerClient { |
142 // Invoked when the client application has been embedded at |root|. | 149 // Invoked when the client application has been embedded at |root|. |
143 // See Embed() on ViewManagerService for more details. |view_manager_service| | 150 // See Embed() on ViewManagerService for more details. |view_manager_service| |
144 // will be a handle back to the view manager service, unless the connection is | 151 // will be a handle back to the view manager service, unless the connection is |
145 // to the WindowManager in which case it will be null. | 152 // to the WindowManager in which case it will be null. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 // NOTE: This is not invoked if OnViewVisibilityChanged() is invoked. | 206 // NOTE: This is not invoked if OnViewVisibilityChanged() is invoked. |
200 OnViewDrawnStateChanged(uint32 view, bool drawn); | 207 OnViewDrawnStateChanged(uint32 view, bool drawn); |
201 | 208 |
202 // Invoked when a view property is changed. If this change is a removal, | 209 // Invoked when a view property is changed. If this change is a removal, |
203 // |new_data| is null. | 210 // |new_data| is null. |
204 OnViewSharedPropertyChanged(uint32 view, string name, array<uint8>? new_data); | 211 OnViewSharedPropertyChanged(uint32 view, string name, array<uint8>? new_data); |
205 | 212 |
206 // Invoked when an event is targeted at the specified view. | 213 // Invoked when an event is targeted at the specified view. |
207 OnViewInputEvent(uint32 view, mojo.Event event) => (); | 214 OnViewInputEvent(uint32 view, mojo.Event event) => (); |
208 }; | 215 }; |
OLD | NEW |