Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: components/mus/public/interfaces/window_tree.mojom

Issue 2068093002: mus: Allow embedder to intercept events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/mus/public/cpp/window_tree_client.h ('k') | components/mus/ws/display_binding.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/ipc/surface_id.mojom"; 7 import "cc/ipc/surface_id.mojom";
8 import "components/mus/public/interfaces/compositor_frame.mojom"; 8 import "components/mus/public/interfaces/compositor_frame.mojom";
9 import "components/mus/public/interfaces/cursor.mojom"; 9 import "components/mus/public/interfaces/cursor.mojom";
10 import "components/mus/public/interfaces/event_matcher.mojom"; 10 import "components/mus/public/interfaces/event_matcher.mojom";
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // in the Window than the owner may also render to this surface as well. 45 // in the Window than the owner may also render to this surface as well.
46 DEFAULT, 46 DEFAULT,
47 }; 47 };
48 48
49 // The result of an input event sent to a client app. 49 // The result of an input event sent to a client app.
50 enum EventResult { 50 enum EventResult {
51 HANDLED, 51 HANDLED,
52 UNHANDLED, 52 UNHANDLED,
53 }; 53 };
54 54
55 // When this flag is set in a call to Embed(), the embedder (i.e. the client
56 // that is making the call to Embed()) will receive events that are targeted to
57 // the embedded client. The embedded client will not receive any input events
58 // from the window server. However, the embedder can choose to dispatch events
59 // to the embedded client through other mechanism.
Ben Goodger (Google) 2016/06/16 17:34:36 What other mechanism?
sadrul 2016/06/16 17:45:16 In the case of chrome, the browser has another IPC
60 const uint32 kEmbedFlagEmbedderInterceptsEvents = 0x01;
61
55 // Windows are identified by a uint32. The upper 16 bits are the connection id, 62 // Windows are identified by a uint32. The upper 16 bits are the connection id,
56 // and the lower 16 the id assigned by the client. 63 // and the lower 16 the id assigned by the client.
57 // 64 //
58 // The root window is identified with a connection id of 0, and value of 1. 65 // The root window is identified with a connection id of 0, and value of 1.
59 // 66 //
60 // Most functions to the WindowTree take a change_id parameter. When 67 // Most functions to the WindowTree take a change_id parameter. When
61 // WindowTree completes processing of a function WindowTree calls 68 // WindowTree completes processing of a function WindowTree calls
62 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the 69 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the
63 // client and the result of the function. This allows the client to track 70 // client and the result of the function. This allows the client to track
64 // whether the call succeeded or not. Calls are done via the client interface 71 // whether the call succeeded or not. Calls are done via the client interface
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 213
207 // A connection may grant access to another connection by way of Embed(). 214 // A connection may grant access to another connection by way of Embed().
208 // Embed() results in the supplied WindowTreeClient being configured with a 215 // Embed() results in the supplied WindowTreeClient being configured with a
209 // root window of |window_id|. The supplied WindowTreeClient may create child 216 // root window of |window_id|. The supplied WindowTreeClient may create child
210 // windows and do other various tree operations (including Embed()), but does 217 // windows and do other various tree operations (including Embed()), but does
211 // not see nor have access to any of the windows above the embed point. 218 // not see nor have access to any of the windows above the embed point.
212 // 219 //
213 // The caller must have created |window_id|. If not the request fails and the 220 // The caller must have created |window_id|. If not the request fails and the
214 // response is false. 221 // response is false.
215 // 222 //
223 // The embedder can dictate the behaviour of the embedded client by setting
224 // the appropriate embed flags (e.g. kEmbedFlagEmbedderInterceptsEvents).
225 //
216 // When a connection embeds a WindowTreeClient the originating connection no 226 // When a connection embeds a WindowTreeClient the originating connection no
217 // longer has privileges to access or see any of the children of the window. 227 // longer has privileges to access or see any of the children of the window.
218 // If the window had existing children the children are removed. The 228 // If the window had existing children the children are removed. The
219 // WindowManager gets to see the whole tree. 229 // WindowManager gets to see the whole tree.
220 // 230 //
221 // A window may only have one embedding in it at a time. Subsequent calls to 231 // A window may only have one embedding in it at a time. Subsequent calls to
222 // Embed() for the same window result in the currently embedded 232 // Embed() for the same window result in the currently embedded
223 // WindowTreeClient being removed. The embedded app is told this by way of 233 // WindowTreeClient being removed. The embedded app is told this by way of
224 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no 234 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no
225 // longer has access to the window). 235 // longer has access to the window).
226 // 236 //
227 // The embedder can detect when the embedded app disconnects by way of 237 // The embedder can detect when the embedded app disconnects by way of
228 // OnEmbeddedAppDisconnected(). 238 // OnEmbeddedAppDisconnected().
229 // 239 //
230 // The callback returns whether the embedding was successful. 240 // The callback returns whether the embedding was successful.
231 Embed(uint32 window_id, WindowTreeClient client) => (bool success); 241 Embed(uint32 window_id, WindowTreeClient client, uint32 embed_flags)
242 => (bool success);
232 243
233 // Sets focus to the specified window, use 0 to clear focus. For a window to 244 // Sets focus to the specified window, use 0 to clear focus. For a window to
234 // get focus the following has to happen: the window is drawn, the window has 245 // get focus the following has to happen: the window is drawn, the window has
235 // been marked as focusable (see SetCanFocus()) and the window is in a 246 // been marked as focusable (see SetCanFocus()) and the window is in a
236 // container the WindowManager has identified as allowing activation 247 // container the WindowManager has identified as allowing activation
237 // (see WindowManagerClient::AddActivationParent()). 248 // (see WindowManagerClient::AddActivationParent()).
238 SetFocus(uint32 change_id, uint32 window_id); 249 SetFocus(uint32 change_id, uint32 window_id);
239 250
240 // Marks the specified window as being able to receive focus. 251 // Marks the specified window as being able to receive focus.
241 SetCanFocus(uint32 window_id, bool can_focus); 252 SetCanFocus(uint32 window_id, bool can_focus);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 // See description of WindowManager for details. 412 // See description of WindowManager for details.
402 GetWindowManager(associated WindowManager& internal); 413 GetWindowManager(associated WindowManager& internal);
403 }; 414 };
404 415
405 // Mus provides this interface as a way for clients to connect and obtain a 416 // Mus provides this interface as a way for clients to connect and obtain a
406 // WindowTree handle with a supplied WindowTreeClient handle. The 417 // WindowTree handle with a supplied WindowTreeClient handle. The
407 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. 418 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one.
408 interface WindowTreeFactory { 419 interface WindowTreeFactory {
409 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); 420 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client);
410 }; 421 };
OLDNEW
« no previous file with comments | « components/mus/public/cpp/window_tree_client.h ('k') | components/mus/ws/display_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698