| 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 import "mojo/public/interfaces/application/service_provider.mojom" | 5 import "mojo/public/interfaces/application/service_provider.mojom" |
| 6 import "mojo/services/public/interfaces/geometry/geometry.mojom" | 6 import "mojo/services/public/interfaces/geometry/geometry.mojom" |
| 7 import "mojo/services/public/interfaces/input_events/input_events.mojom" | 7 import "mojo/services/public/interfaces/input_events/input_events.mojom" |
| 8 import "mojo/services/public/interfaces/view_manager/view_manager_constants.mojo
m" | 8 import "mojo/services/public/interfaces/view_manager/view_manager_constants.mojo
m" |
| 9 | 9 |
| 10 module mojo { | 10 module mojo { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 interface ViewManagerInitService { | 27 interface ViewManagerInitService { |
| 28 // Embed the application @ |url| at an appropriate View. | 28 // Embed the application @ |url| at an appropriate View. |
| 29 // The first time this method is called in the lifetime of a View Manager | 29 // The first time this method is called in the lifetime of a View Manager |
| 30 // application instance, the "appropriate View" is defined as being the | 30 // application instance, the "appropriate View" is defined as being the |
| 31 // service root View. | 31 // service root View. |
| 32 // Subsequent times, implementation of this method is delegated to the | 32 // Subsequent times, implementation of this method is delegated to the |
| 33 // application embedded at the service root View. This application is | 33 // application embedded at the service root View. This application is |
| 34 // typically referred to as the "window manager", and will have a specific | 34 // typically referred to as the "window manager", and will have a specific |
| 35 // definition of where within its View hierarchy to embed an unparented URL. | 35 // definition of where within its View hierarchy to embed an unparented URL. |
| 36 // See ViewManagerService below for more details about |service_provider|. | 36 // See ViewManagerService below for more details about |service_provider|. |
| 37 Embed(string url, ServiceProvider service_provider) => (bool success); | 37 Embed(string url, ServiceProvider? service_provider) => (bool success); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // Views are identified by a uint32. The upper 16 bits are the connection id, | 40 // Views are identified by a uint32. The upper 16 bits are the connection id, |
| 41 // and the lower 16 the id assigned by the client. | 41 // and the lower 16 the id assigned by the client. |
| 42 // | 42 // |
| 43 // The root view is identified with a connection id of 0, and value of 1. | 43 // The root view is identified with a connection id of 0, and value of 1. |
| 44 [Client=ViewManagerClient] | 44 [Client=ViewManagerClient] |
| 45 interface ViewManagerService { | 45 interface ViewManagerService { |
| 46 // Creates a new view with the specified id. It is up to the client to ensure | 46 // Creates a new view with the specified id. It is up to the client to ensure |
| 47 // the id is unique to the connection (the id need not be globally unique). | 47 // the id is unique to the connection (the id need not be globally unique). |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // window manager). | 129 // window manager). |
| 130 // | 130 // |
| 131 // |service_provider| encapsulates services offered by the embedder to the | 131 // |service_provider| encapsulates services offered by the embedder to the |
| 132 // embedded app alongside this Embed() call. It also provides a means for | 132 // embedded app alongside this Embed() call. It also provides a means for |
| 133 // the embedder to connect to services symmetrically exposed by the embedded | 133 // the embedder to connect to services symmetrically exposed by the embedded |
| 134 // app. Note that if a different app is subsequently embedded at |view_id| | 134 // app. Note that if a different app is subsequently embedded at |view_id| |
| 135 // the |service_provider|'s connection to its client in the embedded app and | 135 // the |service_provider|'s connection to its client in the embedded app and |
| 136 // any services it provided are not broken and continue to be valid. | 136 // any services it provided are not broken and continue to be valid. |
| 137 Embed(string url, | 137 Embed(string url, |
| 138 uint32 view_id, | 138 uint32 view_id, |
| 139 ServiceProvider service_provider) => (bool success); | 139 ServiceProvider? service_provider) => (bool success); |
| 140 | 140 |
| 141 // TODO(sky): move these to a separate interface when FIFO works. | 141 // TODO(sky): move these to a separate interface when FIFO works. |
| 142 | 142 |
| 143 // Sends OnViewInputEvent() to the owner of the specified view. | 143 // Sends OnViewInputEvent() to the owner of the specified view. |
| 144 DispatchOnViewInputEvent(uint32 view_id, mojo.Event event); | 144 DispatchOnViewInputEvent(uint32 view_id, mojo.Event event); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 // Changes to views are not sent to the connection that originated the | 147 // Changes to views are not sent to the connection that originated the |
| 148 // change. For example, if connection 1 changes the bounds of a view by calling | 148 // change. For example, if connection 1 changes the bounds of a view by calling |
| 149 // SetBounds(), connection 1 does not receive OnViewBoundsChanged(). | 149 // SetBounds(), connection 1 does not receive OnViewBoundsChanged(). |
| 150 [Client=ViewManagerService] | 150 [Client=ViewManagerService] |
| 151 interface ViewManagerClient { | 151 interface ViewManagerClient { |
| 152 // Invoked when the client application has been embedded at |root|. | 152 // Invoked when the client application has been embedded at |root|. |
| 153 // See Embed() on ViewManagerService for more details. | 153 // See Embed() on ViewManagerService for more details. |
| 154 OnEmbed(uint16 connection_id, | 154 OnEmbed(uint16 connection_id, |
| 155 string embedder_url, | 155 string embedder_url, |
| 156 ViewData root, | 156 ViewData root, |
| 157 ServiceProvider& service_provider); | 157 ServiceProvider&? service_provider); |
| 158 | 158 |
| 159 // Invoked when a view's bounds have changed. | 159 // Invoked when a view's bounds have changed. |
| 160 OnViewBoundsChanged(uint32 view, mojo.Rect old_bounds, mojo.Rect new_bounds); | 160 OnViewBoundsChanged(uint32 view, mojo.Rect old_bounds, mojo.Rect new_bounds); |
| 161 | 161 |
| 162 // Invoked when a change is done to the hierarchy. A value of 0 is used to | 162 // Invoked when a change is done to the hierarchy. A value of 0 is used to |
| 163 // identify a null view. For example, if the old_parent is NULL, 0 is | 163 // identify a null view. For example, if the old_parent is NULL, 0 is |
| 164 // supplied. | 164 // supplied. |
| 165 // |views| contains any views that are that the client has not been told | 165 // |views| contains any views that are that the client has not been told |
| 166 // about. This is not sent for hierarchy changes of views not known to this | 166 // about. This is not sent for hierarchy changes of views not known to this |
| 167 // client or not attached to the tree. | 167 // client or not attached to the tree. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 181 // Invoked when an event is targeted at the specified view. | 181 // Invoked when an event is targeted at the specified view. |
| 182 OnViewInputEvent(uint32 view, mojo.Event event) => (); | 182 OnViewInputEvent(uint32 view, mojo.Event event) => (); |
| 183 | 183 |
| 184 // TODO(sky): The following methods represent an interface between the view | 184 // TODO(sky): The following methods represent an interface between the view |
| 185 // manager and the application embedded at the service root view | 185 // manager and the application embedded at the service root view |
| 186 // (i.e. the window manager). These methods are not called on | 186 // (i.e. the window manager). These methods are not called on |
| 187 // any other clients. They should be moved to a separate interface | 187 // any other clients. They should be moved to a separate interface |
| 188 // once support for derived FIFOs is landed. | 188 // once support for derived FIFOs is landed. |
| 189 | 189 |
| 190 // Requests the window manager create a "top level" view embedding |url|. | 190 // Requests the window manager create a "top level" view embedding |url|. |
| 191 Embed(string url, ServiceProvider& service_provider); | 191 Embed(string url, ServiceProvider&? service_provider); |
| 192 | 192 |
| 193 // Requests the view manager dispatch the event. | 193 // Requests the view manager dispatch the event. |
| 194 DispatchOnViewInputEvent(mojo.Event event); | 194 DispatchOnViewInputEvent(mojo.Event event); |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 } | 197 } |
| OLD | NEW |