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/services/public/interfaces/geometry/geometry.mojom" | 5 import "mojo/services/public/interfaces/geometry/geometry.mojom" |
6 import "mojo/services/public/interfaces/input_events/input_events.mojom" | 6 import "mojo/services/public/interfaces/input_events/input_events.mojom" |
7 import "mojo/services/public/interfaces/view_manager/view_manager_constants.mojo
m" | 7 import "mojo/services/public/interfaces/view_manager/view_manager_constants.mojo
m" |
8 | 8 |
9 module mojo.view_manager { | 9 module mojo.view_manager { |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 // Shows the specified image (png encoded) in the specified view. | 121 // Shows the specified image (png encoded) in the specified view. |
122 SetViewContents(uint32 view_id, | 122 SetViewContents(uint32 view_id, |
123 handle<shared_buffer> buffer, | 123 handle<shared_buffer> buffer, |
124 uint32 buffer_size) => (bool success); | 124 uint32 buffer_size) => (bool success); |
125 | 125 |
126 // Sets focus to the specified node. | 126 // Sets focus to the specified node. |
127 SetFocus(uint32 node_id) => (bool success); | 127 SetFocus(uint32 node_id) => (bool success); |
128 | 128 |
129 // Embeds the app for |url| in the specified node. More specifically this | 129 // Embeds the app for |url| in the specified node. More specifically this |
130 // creates a new connection to the specified url, expecting to get an | 130 // creates a new connection to the specified url, expecting to get a |
131 // ViewManagerClient and configures it with the root node |node|. Fails | 131 // ViewManagerClient and configures it with the root node |node|. Fails |
132 // if |node| was not created by this connection. | 132 // if |node| was not created by this connection. |
| 133 // |
133 // If a particular client invokes Embed() multiple times with the same url, | 134 // If a particular client invokes Embed() multiple times with the same url, |
134 // the connection is reused. When this happens the ViewManagerClient is | 135 // the connection is reused. When this happens the ViewManagerClient is |
135 // notified of the additional roots by way of OnRootAdded(). | 136 // notified of the additional roots by way of OnRootAdded(). |
| 137 // |
| 138 // A node may only be a root of one connection at a time. Subsequent calls to |
| 139 // Embed() for the same node result in the node being removed from the |
| 140 // current connection. The current connection is told this by way of |
| 141 // OnNodeDeleted(). |
| 142 // |
| 143 // This advances the server change id. |
136 Embed(string url, uint32 node_id) => (bool success); | 144 Embed(string url, uint32 node_id) => (bool success); |
137 | 145 |
138 // TODO(sky): move these to a separate interface when FIFO works. | 146 // TODO(sky): move these to a separate interface when FIFO works. |
139 | 147 |
140 // Sends OnViewInputEvent() to the owner of the specified view. | 148 // Sends OnViewInputEvent() to the owner of the specified view. |
141 DispatchOnViewInputEvent(uint32 view_id, mojo.Event event); | 149 DispatchOnViewInputEvent(uint32 view_id, mojo.Event event); |
142 }; | 150 }; |
143 | 151 |
144 // Changes to nodes/views are not sent to the connection that originated the | 152 // Changes to nodes/views are not sent to the connection that originated the |
145 // change. For example, if connection 1 attaches a view to a node (SetView()) | 153 // change. For example, if connection 1 attaches a view to a node (SetView()) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // entirely move to the window manager and this method can be | 217 // entirely move to the window manager and this method can be |
210 // removed. | 218 // removed. |
211 OnFocusChanged(uint32 gained_focus_id, uint32 lost_focus_id); | 219 OnFocusChanged(uint32 gained_focus_id, uint32 lost_focus_id); |
212 | 220 |
213 // TODO(sky): move to separate interface when FIFO sorted out. | 221 // TODO(sky): move to separate interface when FIFO sorted out. |
214 | 222 |
215 DispatchOnViewInputEvent(uint32 view, mojo.Event event); | 223 DispatchOnViewInputEvent(uint32 view, mojo.Event event); |
216 }; | 224 }; |
217 | 225 |
218 } | 226 } |
OLD | NEW |