| 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 "mojo/public/interfaces/application/service_provider.mojom"; | 7 import "mojo/public/interfaces/application/service_provider.mojom"; |
| 8 import "mojo/services/public/interfaces/geometry/geometry.mojom"; | 8 import "mojo/services/public/interfaces/geometry/geometry.mojom"; |
| 9 import "mojo/services/public/interfaces/input_events/input_events.mojom"; | 9 import "mojo/services/public/interfaces/input_events/input_events.mojom"; |
| 10 import "mojo/services/public/interfaces/surfaces/surface_id.mojom"; | 10 import "mojo/services/public/interfaces/surfaces/surface_id.mojom"; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // Shows the surface in the specified view. | 104 // Shows the surface in the specified view. |
| 105 SetViewSurfaceId(uint32 view_id, SurfaceId surface_id) => (bool success); | 105 SetViewSurfaceId(uint32 view_id, SurfaceId surface_id) => (bool success); |
| 106 | 106 |
| 107 // Embeds the app for |url| in the specified view. More specifically this | 107 // Embeds the app for |url| in the specified view. More specifically this |
| 108 // creates a new connection to the specified url, expecting to get a | 108 // creates a new connection to the specified url, expecting to get a |
| 109 // ViewManagerClient and configures it with the root view |view|. Fails | 109 // ViewManagerClient and configures it with the root view |view|. Fails |
| 110 // if |view| was not created by this connection. | 110 // if |view| was not created by this connection. |
| 111 // | 111 // |
| 112 // A view may only be a root of one connection at a time. Subsequent calls to | 112 // A view may only be a root of one connection at a time. Subsequent calls to |
| 113 // Embed() for the same view result in the view being removed from the | 113 // Embed() for the same view result in the view being removed from the |
| 114 // current connection. The current connection is told this by way of | 114 // currently embedded app. The embedded app is told this by way of |
| 115 // OnViewDeleted(). | 115 // OnViewDeleted(). |
| 116 // | 116 // |
| 117 // The embedder can detect when the embedded app disconnects by way of |
| 118 // OnEmbeddedAppDisconnected(). |
| 119 // |
| 117 // When a connection embeds an app the connection no longer has priviledges | 120 // When a connection embeds an app the connection no longer has priviledges |
| 118 // to access or see any of the children of the view. If the view had existing | 121 // to access or see any of the children of the view. If the view had existing |
| 119 // children the children are removed. The one exception is the root | 122 // children the children are removed. The one exception is the root |
| 120 // connection. | 123 // connection. |
| 121 // | 124 // |
| 122 // |service_provider| encapsulates services offered by the embedder to the | 125 // |service_provider| encapsulates services offered by the embedder to the |
| 123 // embedded app alongside this Embed() call. It also provides a means for | 126 // embedded app alongside this Embed() call. It also provides a means for |
| 124 // the embedder to connect to services symmetrically exposed by the embedded | 127 // the embedder to connect to services symmetrically exposed by the embedded |
| 125 // app. Note that if a different app is subsequently embedded at |view_id| | 128 // app. Note that if a different app is subsequently embedded at |view_id| |
| 126 // the |service_provider|'s connection to its client in the embedded app and | 129 // the |service_provider|'s connection to its client in the embedded app and |
| (...skipping 10 matching lines...) Expand all Loading... |
| 137 interface ViewManagerClient { | 140 interface ViewManagerClient { |
| 138 // Invoked when the client application has been embedded at |root|. | 141 // Invoked when the client application has been embedded at |root|. |
| 139 // See Embed() on ViewManagerService for more details. |window_manager_pipe| | 142 // See Embed() on ViewManagerService for more details. |window_manager_pipe| |
| 140 // is a pipe to the WindowManager. | 143 // is a pipe to the WindowManager. |
| 141 OnEmbed(uint16 connection_id, | 144 OnEmbed(uint16 connection_id, |
| 142 string embedder_url, | 145 string embedder_url, |
| 143 ViewData root, | 146 ViewData root, |
| 144 ServiceProvider&? parent_service_provider, | 147 ServiceProvider&? parent_service_provider, |
| 145 handle<message_pipe> window_manager_pipe); | 148 handle<message_pipe> window_manager_pipe); |
| 146 | 149 |
| 150 // Invoked when the application embedded at |view| is disconnected. |
| 151 OnEmbeddedAppDisconnected(uint32 view); |
| 152 |
| 147 // Invoked when a view's bounds have changed. | 153 // Invoked when a view's bounds have changed. |
| 148 OnViewBoundsChanged(uint32 view, | 154 OnViewBoundsChanged(uint32 view, |
| 149 mojo.Rect old_bounds, | 155 mojo.Rect old_bounds, |
| 150 mojo.Rect new_bounds); | 156 mojo.Rect new_bounds); |
| 151 | 157 |
| 152 // Invoked when a change is done to the hierarchy. A value of 0 is used to | 158 // Invoked when a change is done to the hierarchy. A value of 0 is used to |
| 153 // identify a null view. For example, if the old_parent is NULL, 0 is | 159 // identify a null view. For example, if the old_parent is NULL, 0 is |
| 154 // supplied. | 160 // supplied. |
| 155 // |views| contains any views that are that the client has not been told | 161 // |views| contains any views that are that the client has not been told |
| 156 // about. This is not sent for hierarchy changes of views not known to this | 162 // about. This is not sent for hierarchy changes of views not known to this |
| (...skipping 26 matching lines...) Expand all Loading... |
| 183 // NOTE: This is not invoked if OnViewVisibilityChanged() is invoked. | 189 // NOTE: This is not invoked if OnViewVisibilityChanged() is invoked. |
| 184 OnViewDrawnStateChanged(uint32 view, bool drawn); | 190 OnViewDrawnStateChanged(uint32 view, bool drawn); |
| 185 | 191 |
| 186 // Invoked when a view property is changed. If this change is a removal, | 192 // Invoked when a view property is changed. If this change is a removal, |
| 187 // |new_data| is null. | 193 // |new_data| is null. |
| 188 OnViewPropertyChanged(uint32 view, string name, array<uint8>? new_data); | 194 OnViewPropertyChanged(uint32 view, string name, array<uint8>? new_data); |
| 189 | 195 |
| 190 // Invoked when an event is targeted at the specified view. | 196 // Invoked when an event is targeted at the specified view. |
| 191 OnViewInputEvent(uint32 view, mojo.Event event) => (); | 197 OnViewInputEvent(uint32 view, mojo.Event event) => (); |
| 192 }; | 198 }; |
| OLD | NEW |