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 mus.mojom; | 5 module mus.mojom; |
6 | 6 |
7 import "components/mus/public/interfaces/compositor_frame.mojom"; | 7 import "components/mus/public/interfaces/compositor_frame.mojom"; |
8 import "components/mus/public/interfaces/cursor.mojom"; | 8 import "components/mus/public/interfaces/cursor.mojom"; |
9 import "components/mus/public/interfaces/input_events.mojom"; | 9 import "components/mus/public/interfaces/input_events.mojom"; |
10 import "components/mus/public/interfaces/mus_constants.mojom"; | 10 import "components/mus/public/interfaces/mus_constants.mojom"; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // | 61 // |
62 // Most functions to the WindowTree take a change_id parameter. When | 62 // Most functions to the WindowTree take a change_id parameter. When |
63 // WindowTree completes processing of a function WindowTree calls | 63 // WindowTree completes processing of a function WindowTree calls |
64 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the | 64 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the |
65 // client and the result of the function. This allows the client to track | 65 // client and the result of the function. This allows the client to track |
66 // whether the call succeeded or not. Calls are done via the client interface | 66 // whether the call succeeded or not. Calls are done via the client interface |
67 // rather than a callback to ensure ordering. The server does not interpret the | 67 // rather than a callback to ensure ordering. The server does not interpret the |
68 // change id in anyway, it is up to the client to assign a value and use it. | 68 // change id in anyway, it is up to the client to assign a value and use it. |
69 // Generally the change id is an ever increasing integer. | 69 // Generally the change id is an ever increasing integer. |
70 interface WindowTree { | 70 interface WindowTree { |
71 enum AccessPolicy { | 71 const int32 kAccessPolicyDefault = 0; |
72 DEFAULT = 0, | |
73 | 72 |
74 // An embed root has the following abilities: | 73 // An embed root has the following abilities: |
75 // . The app sees all the descendants of the window the app is ebmedded at, | 74 // . The app sees all the descendants of the window the app is ebmedded at, |
76 // even those from separate connections. | 75 // even those from separate connections. |
77 // . The app is able to Embed() in all the descendants of the window the app | 76 // . The app is able to Embed() in all the descendants of the window the app |
78 // is embedded at, even those from separate connections. | 77 // is embedded at, even those from separate connections. |
79 // Only connections originating from the WindowTreeHostFactory can grant | 78 // Only connections originating from the WindowTreeHostFactory can grant |
80 // this policy. | 79 // this policy. |
81 EMBED_ROOT = 1, | 80 const int32 kAccessPolicyEmbedRoot = 1; |
82 }; | |
83 | 81 |
84 // Creates a new window with the specified id. It is up to the client to | 82 // Creates a new window with the specified id. It is up to the client to |
85 // ensure the id is unique to the connection (the id need not be globally | 83 // ensure the id is unique to the connection (the id need not be globally |
86 // unique). Additionally the connection id (embedded in |window_id|) must | 84 // unique). Additionally the connection id (embedded in |window_id|) must |
87 // match that of the connection. | 85 // match that of the connection. |
88 // Errors: | 86 // Errors: |
89 // ERROR_CODE_VALUE_IN_USE: a window already exists with the specified id. | 87 // ERROR_CODE_VALUE_IN_USE: a window already exists with the specified id. |
90 // ERROR_CODE_ILLEGAL_ARGUMENT: The connection part of |window_id| does not | 88 // ERROR_CODE_ILLEGAL_ARGUMENT: The connection part of |window_id| does not |
91 // match the connection id of the client. | 89 // match the connection id of the client. |
92 NewWindow(uint32 change_id, | 90 NewWindow(uint32 change_id, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // windows and do other various tree operations (including Embed()), but does | 178 // windows and do other various tree operations (including Embed()), but does |
181 // not see nor have access to any of the windows above the embed point. | 179 // not see nor have access to any of the windows above the embed point. |
182 // | 180 // |
183 // The caller must have created |window_id|. If not the request fails and the | 181 // The caller must have created |window_id|. If not the request fails and the |
184 // response is false. | 182 // response is false. |
185 // | 183 // |
186 // When a connection embeds a WindowTreeClient the originating connection no | 184 // When a connection embeds a WindowTreeClient the originating connection no |
187 // longer has privileges to access or see any of the children of the window. | 185 // longer has privileges to access or see any of the children of the window. |
188 // If the window had existing children the children are removed. The one | 186 // If the window had existing children the children are removed. The one |
189 // exception is the root connection and any connections with the policy | 187 // exception is the root connection and any connections with the policy |
190 // ACCESS_POLICY_EMBED_ROOT. | 188 // kAccessPolicyEmbedRoot. |
191 // | 189 // |
192 // A window may only have one embedding in it at a time. Subsequent calls to | 190 // A window may only have one embedding in it at a time. Subsequent calls to |
193 // Embed() for the same window result in the currently embedded | 191 // Embed() for the same window result in the currently embedded |
194 // WindowTreeClient being removed. The embedded app is told this by way of | 192 // WindowTreeClient being removed. The embedded app is told this by way of |
195 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no | 193 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no |
196 // longer has access to the window). | 194 // longer has access to the window). |
197 // | 195 // |
198 // The embedder can detect when the embedded app disconnects by way of | 196 // The embedder can detect when the embedded app disconnects by way of |
199 // OnEmbeddedAppDisconnected(). | 197 // OnEmbeddedAppDisconnected(). |
200 // | 198 // |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 // This interface is only used as an associated interface and is associated | 364 // This interface is only used as an associated interface and is associated |
367 // with WindowTree. | 365 // with WindowTree. |
368 interface WindowManagerInternalClient { | 366 interface WindowManagerInternalClient { |
369 // The window manager has completed a request with the specific change id. | 367 // The window manager has completed a request with the specific change id. |
370 WmResponse(uint32 change_id, bool response); | 368 WmResponse(uint32 change_id, bool response); |
371 | 369 |
372 // Calls WindowTreeClient::RequestClose() on the embedded app at the | 370 // Calls WindowTreeClient::RequestClose() on the embedded app at the |
373 // specified window. | 371 // specified window. |
374 WmRequestClose(uint32 window_id); | 372 WmRequestClose(uint32 window_id); |
375 }; | 373 }; |
OLD | NEW |