| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // windows and do other various tree operations (including Embed()), but does | 186 // windows and do other various tree operations (including Embed()), but does |
| 189 // not see nor have access to any of the windows above the embed point. | 187 // not see nor have access to any of the windows above the embed point. |
| 190 // | 188 // |
| 191 // The caller must have created |window_id|. If not the request fails and the | 189 // The caller must have created |window_id|. If not the request fails and the |
| 192 // response is false. | 190 // response is false. |
| 193 // | 191 // |
| 194 // When a connection embeds a WindowTreeClient the originating connection no | 192 // When a connection embeds a WindowTreeClient the originating connection no |
| 195 // longer has privileges to access or see any of the children of the window. | 193 // longer has privileges to access or see any of the children of the window. |
| 196 // If the window had existing children the children are removed. The one | 194 // If the window had existing children the children are removed. The one |
| 197 // exception is the root connection and any connections with the policy | 195 // exception is the root connection and any connections with the policy |
| 198 // ACCESS_POLICY_EMBED_ROOT. | 196 // kAccessPolicyEmbedRoot. |
| 199 // | 197 // |
| 200 // A window may only have one embedding in it at a time. Subsequent calls to | 198 // A window may only have one embedding in it at a time. Subsequent calls to |
| 201 // Embed() for the same window result in the currently embedded | 199 // Embed() for the same window result in the currently embedded |
| 202 // WindowTreeClient being removed. The embedded app is told this by way of | 200 // WindowTreeClient being removed. The embedded app is told this by way of |
| 203 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no | 201 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no |
| 204 // longer has access to the window). | 202 // longer has access to the window). |
| 205 // | 203 // |
| 206 // The embedder can detect when the embedded app disconnects by way of | 204 // The embedder can detect when the embedded app disconnects by way of |
| 207 // OnEmbeddedAppDisconnected(). | 205 // OnEmbeddedAppDisconnected(). |
| 208 // | 206 // |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 WmResponse(uint32 change_id, bool response); | 387 WmResponse(uint32 change_id, bool response); |
| 390 | 388 |
| 391 // Calls WindowTreeClient::RequestClose() on the embedded app at the | 389 // Calls WindowTreeClient::RequestClose() on the embedded app at the |
| 392 // specified window. | 390 // specified window. |
| 393 WmRequestClose(uint32 window_id); | 391 WmRequestClose(uint32 window_id); |
| 394 | 392 |
| 395 // Response from WmCreateTopLevelWindow() informing the client of the id for | 393 // Response from WmCreateTopLevelWindow() informing the client of the id for |
| 396 // the new window. | 394 // the new window. |
| 397 OnWmCreatedTopLevelWindow(uint32 change_id, uint32 window_id); | 395 OnWmCreatedTopLevelWindow(uint32 change_id, uint32 window_id); |
| 398 }; | 396 }; |
| OLD | NEW |