| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // the first result in the return value, unless |view_id| is invalid, in which | 98 // the first result in the return value, unless |view_id| is invalid, in which |
| 99 // case an empty vector is returned. The views are visited using a depth first | 99 // case an empty vector is returned. The views are visited using a depth first |
| 100 // search (pre-order). | 100 // search (pre-order). |
| 101 GetViewTree(uint32 view_id) => (ViewData[] views); | 101 GetViewTree(uint32 view_id) => (ViewData[] views); |
| 102 | 102 |
| 103 // Shows the specified image (png encoded) in the specified view. | 103 // Shows the specified image (png encoded) in the specified view. |
| 104 SetViewContents(uint32 view_id, | 104 SetViewContents(uint32 view_id, |
| 105 handle<shared_buffer> buffer, | 105 handle<shared_buffer> buffer, |
| 106 uint32 buffer_size) => (bool success); | 106 uint32 buffer_size) => (bool success); |
| 107 | 107 |
| 108 // Sets focus to the specified view. | |
| 109 SetFocus(uint32 view_id) => (bool success); | |
| 110 | |
| 111 // Embeds the app for |url| in the specified view. More specifically this | 108 // Embeds the app for |url| in the specified view. More specifically this |
| 112 // creates a new connection to the specified url, expecting to get a | 109 // creates a new connection to the specified url, expecting to get a |
| 113 // ViewManagerClient and configures it with the root view |view|. Fails | 110 // ViewManagerClient and configures it with the root view |view|. Fails |
| 114 // if |view| was not created by this connection. | 111 // if |view| was not created by this connection. |
| 115 // | 112 // |
| 116 // If a particular client invokes Embed() multiple times with the same url, | 113 // If a particular client invokes Embed() multiple times with the same url, |
| 117 // the connection is reused. When this happens the ViewManagerClient is | 114 // the connection is reused. When this happens the ViewManagerClient is |
| 118 // notified of the additional roots by way of OnEmbed(). | 115 // notified of the additional roots by way of OnEmbed(). |
| 119 // | 116 // |
| 120 // A view may only be a root of one connection at a time. Subsequent calls to | 117 // A view may only be a root of one connection at a time. Subsequent calls to |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 OnViewReordered(uint32 view_id, | 174 OnViewReordered(uint32 view_id, |
| 178 uint32 relative_view_id, | 175 uint32 relative_view_id, |
| 179 OrderDirection direction); | 176 OrderDirection direction); |
| 180 | 177 |
| 181 // Invoked when a view is deleted. | 178 // Invoked when a view is deleted. |
| 182 OnViewDeleted(uint32 view); | 179 OnViewDeleted(uint32 view); |
| 183 | 180 |
| 184 // Invoked when an event is targeted at the specified view. | 181 // Invoked when an event is targeted at the specified view. |
| 185 OnViewInputEvent(uint32 view, mojo.Event event) => (); | 182 OnViewInputEvent(uint32 view, mojo.Event event) => (); |
| 186 | 183 |
| 187 // Invoked when focus shifts from one View to another. |gained_focus_id| is | |
| 188 // the id of the view that gained focus, or 0 if the view that gained focus is | |
| 189 // not known to this connection. |lost_focus_id| is likewise the view that | |
| 190 // lost focus. | |
| 191 // TODO(beng): once aura is removed from the service, focus management should | |
| 192 // entirely move to the window manager and this method can be | |
| 193 // removed. | |
| 194 OnFocusChanged(uint32 gained_focus_id, uint32 lost_focus_id); | |
| 195 | |
| 196 // TODO(sky): The following methods represent an interface between the view | 184 // TODO(sky): The following methods represent an interface between the view |
| 197 // manager and the application embedded at the service root view | 185 // manager and the application embedded at the service root view |
| 198 // (i.e. the window manager). These methods are not called on | 186 // (i.e. the window manager). These methods are not called on |
| 199 // any other clients. They should be moved to a separate interface | 187 // any other clients. They should be moved to a separate interface |
| 200 // once support for derived FIFOs is landed. | 188 // once support for derived FIFOs is landed. |
| 201 | 189 |
| 202 // Requests the window manager create a "top level" view embedding |url|. | 190 // Requests the window manager create a "top level" view embedding |url|. |
| 203 Embed(string url, ServiceProvider& service_provider); | 191 Embed(string url, ServiceProvider& service_provider); |
| 204 | 192 |
| 205 // Requests the view manager dispatch the event targeted at |view|. | 193 // Requests the view manager dispatch the event. |
| 206 DispatchOnViewInputEvent(uint32 view, mojo.Event event); | 194 DispatchOnViewInputEvent(mojo.Event event); |
| 207 }; | 195 }; |
| 208 | 196 |
| 209 } | 197 } |
| OLD | NEW |