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

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 const uint32 kEmbedFlagEmbedderInterceptsEvents = 0x01;
Ben Goodger (Google) 2016/06/16 16:53:49 1. Can you use an enum for this, and refer to it f
sadrul 2016/06/16 16:56:59 I had an enum before, but switched to using ints s
56
55 // Windows are identified by a uint32. The upper 16 bits are the connection id, 57 // 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. 58 // and the lower 16 the id assigned by the client.
57 // 59 //
58 // The root window is identified with a connection id of 0, and value of 1. 60 // The root window is identified with a connection id of 0, and value of 1.
59 // 61 //
60 // Most functions to the WindowTree take a change_id parameter. When 62 // Most functions to the WindowTree take a change_id parameter. When
61 // WindowTree completes processing of a function WindowTree calls 63 // WindowTree completes processing of a function WindowTree calls
62 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the 64 // WindowTreeClient::OnChangeCompleted() with the change_id supplied by the
63 // 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
64 // 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
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // A window may only have one embedding in it at a time. Subsequent calls to 223 // 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 224 // Embed() for the same window result in the currently embedded
223 // WindowTreeClient being removed. The embedded app is told this by way of 225 // WindowTreeClient being removed. The embedded app is told this by way of
224 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no 226 // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no
225 // longer has access to the window). 227 // longer has access to the window).
226 // 228 //
227 // The embedder can detect when the embedded app disconnects by way of 229 // The embedder can detect when the embedded app disconnects by way of
228 // OnEmbeddedAppDisconnected(). 230 // OnEmbeddedAppDisconnected().
229 // 231 //
230 // The callback returns whether the embedding was successful. 232 // The callback returns whether the embedding was successful.
231 Embed(uint32 window_id, WindowTreeClient client) => (bool success); 233 Embed(uint32 window_id, WindowTreeClient client, uint32 flags)
234 => (bool success);
232 235
233 // Sets focus to the specified window, use 0 to clear focus. For a window to 236 // 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 237 // 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 238 // been marked as focusable (see SetCanFocus()) and the window is in a
236 // container the WindowManager has identified as allowing activation 239 // container the WindowManager has identified as allowing activation
237 // (see WindowManagerClient::AddActivationParent()). 240 // (see WindowManagerClient::AddActivationParent()).
238 SetFocus(uint32 change_id, uint32 window_id); 241 SetFocus(uint32 change_id, uint32 window_id);
239 242
240 // Marks the specified window as being able to receive focus. 243 // Marks the specified window as being able to receive focus.
241 SetCanFocus(uint32 window_id, bool can_focus); 244 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. 404 // See description of WindowManager for details.
402 GetWindowManager(associated WindowManager& internal); 405 GetWindowManager(associated WindowManager& internal);
403 }; 406 };
404 407
405 // Mus provides this interface as a way for clients to connect and obtain a 408 // Mus provides this interface as a way for clients to connect and obtain a
406 // WindowTree handle with a supplied WindowTreeClient handle. The 409 // WindowTree handle with a supplied WindowTreeClient handle. The
407 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. 410 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one.
408 interface WindowTreeFactory { 411 interface WindowTreeFactory {
409 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); 412 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client);
410 }; 413 };
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