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

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

Issue 1909733002: mus: Add EventObserver to allow passively listening to UI events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 8 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
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 "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/input_event_matcher.mojom";
10 import "components/mus/public/interfaces/mus_constants.mojom"; 11 import "components/mus/public/interfaces/mus_constants.mojom";
11 import "components/mus/public/interfaces/surface_id.mojom"; 12 import "components/mus/public/interfaces/surface_id.mojom";
12 import "components/mus/public/interfaces/window_manager.mojom"; 13 import "components/mus/public/interfaces/window_manager.mojom";
13 import "components/mus/public/interfaces/window_manager_constants.mojom"; 14 import "components/mus/public/interfaces/window_manager_constants.mojom";
14 import "ui/mojo/geometry/geometry.mojom"; 15 import "ui/mojo/geometry/geometry.mojom";
15 import "ui/mojo/ime/text_input_state.mojom"; 16 import "ui/mojo/ime/text_input_state.mojom";
16 17
17 struct ViewportMetrics { 18 struct ViewportMetrics {
18 mojo.Size size_in_pixels; 19 mojo.Size size_in_pixels;
19 // A value of 0 indicates the real value is not yet available. 20 // A value of 0 indicates the real value is not yet available.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // current input events are canceled. The given window will receive all 103 // current input events are canceled. The given window will receive all
103 // subsequent input until an alternate window is set via SetCapture, or 104 // subsequent input until an alternate window is set via SetCapture, or
104 // ReleaseCapture is called for |window_id|. OnLostCapture is called to notify 105 // ReleaseCapture is called for |window_id|. OnLostCapture is called to notify
105 // of capture ending. 106 // of capture ending.
106 SetCapture(uint32 change_id, uint32 window_id); 107 SetCapture(uint32 change_id, uint32 window_id);
107 108
108 // Releases input event capture for the given |window_id|. This does nothing 109 // Releases input event capture for the given |window_id|. This does nothing
109 // if |window_id| does not currently have capture. 110 // if |window_id| does not currently have capture.
110 ReleaseCapture(uint32 change_id, uint32 window_id); 111 ReleaseCapture(uint32 change_id, uint32 window_id);
111 112
113 // Sets an observer that monitors all events, even if they are not targeted
114 // at a window in this tree. If an event matchs |matcher| the observer reports
115 // it to the WindowTreeClient via OnEventObserved(). Each client may only have
116 // one observer at a time. Set the matcher to null to clear the observer.
117 SetEventObserver(EventMatcher? matcher);
118
112 // Sets the specified bounds of the specified window. 119 // Sets the specified bounds of the specified window.
113 SetWindowBounds(uint32 change_id, uint32 window_id, mojo.Rect bounds); 120 SetWindowBounds(uint32 change_id, uint32 window_id, mojo.Rect bounds);
114 121
115 // Sets the client area of the specified window. The client area is specified 122 // Sets the client area of the specified window. The client area is specified
116 // by way of insets. Everything outside of the insets, and not in 123 // by way of insets. Everything outside of the insets, and not in
117 // |additional_client_areas| is considered non-client area. 124 // |additional_client_areas| is considered non-client area.
118 // TODO(sky): convert additional_client_areas to a path. 125 // TODO(sky): convert additional_client_areas to a path.
119 SetClientArea(uint32 window_id, 126 SetClientArea(uint32 window_id,
120 mojo.Insets insets, 127 mojo.Insets insets,
121 array<mojo.Rect>? additional_client_areas); 128 array<mojo.Rect>? additional_client_areas);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 358
352 // Invoked when a window property is changed. If this change is a removal, 359 // Invoked when a window property is changed. If this change is a removal,
353 // |new_data| is null. 360 // |new_data| is null.
354 OnWindowSharedPropertyChanged(uint32 window, 361 OnWindowSharedPropertyChanged(uint32 window,
355 string name, 362 string name,
356 array<uint8>? new_data); 363 array<uint8>? new_data);
357 364
358 // Invoked when an event is targeted at the specified window. The client must 365 // Invoked when an event is targeted at the specified window. The client must
359 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify 366 // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify
360 // that the event has been processed, and with an EventResult value to notify 367 // that the event has been processed, and with an EventResult value to notify
361 // if the event was consumed. The client will not receive farther events until 368 // if the event was consumed. |matched_observer| is true if the event also
362 // the event is ack'ed. 369 // matched the active event observer for this client. The client will not
363 OnWindowInputEvent(uint32 event_id, uint32 window, Event event); 370 // receive farther events until the event is ack'ed.
371 OnWindowInputEvent(uint32 event_id,
372 uint32 window,
373 Event event,
374 bool matched_observer);
sky 2016/04/22 20:18:48 Rather than a bool for matched_observer I think yo
James Cook 2016/04/22 21:25:08 Done.
375
376 // Invoked when an event is sent via the EventObserver and not targeted at a
377 // specific window. The client does not need to acknowledge these events.
sky 2016/04/22 20:18:48 'does not need to' -> should not
James Cook 2016/04/22 21:25:08 Done.
378 OnEventObserved(Event event);
364 379
365 // Called in two distinct cases: when a window known to the connection gains 380 // Called in two distinct cases: when a window known to the connection gains
366 // focus, or when focus moves from a window known to the connection to a 381 // focus, or when focus moves from a window known to the connection to a
367 // window not known to the connection. In the later case |focused_window_id| 382 // window not known to the connection. In the later case |focused_window_id|
368 // is 0. As with other functions this is only called if the client did not 383 // is 0. As with other functions this is only called if the client did not
369 // initiate the change. 384 // initiate the change.
370 OnWindowFocused(uint32 focused_window_id); 385 OnWindowFocused(uint32 focused_window_id);
371 386
372 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); 387 OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id);
373 388
374 // A change initiated from the client has completed. See description of 389 // A change initiated from the client has completed. See description of
375 // change ids for details. 390 // change ids for details.
376 OnChangeCompleted(uint32 change_id, bool success); 391 OnChangeCompleted(uint32 change_id, bool success);
377 392
378 // The WindowManager is requesting the specified window to close. If the 393 // The WindowManager is requesting the specified window to close. If the
379 // client allows the change it should delete the window. 394 // client allows the change it should delete the window.
380 RequestClose(uint32 window_id); 395 RequestClose(uint32 window_id);
381 396
382 // See description of WindowManager for details. 397 // See description of WindowManager for details.
383 GetWindowManager(associated WindowManager& internal); 398 GetWindowManager(associated WindowManager& internal);
384 }; 399 };
385 400
386 // Mus provides this interface as a way for clients to connect and obtain a 401 // Mus provides this interface as a way for clients to connect and obtain a
387 // WindowTree handle with a supplied WindowTreeClient handle. The 402 // WindowTree handle with a supplied WindowTreeClient handle. The
388 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one. 403 // WindowTreeClient has no roots, use NewTopLevelWindow() to create one.
389 interface WindowTreeFactory { 404 interface WindowTreeFactory {
390 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); 405 CreateWindowTree(WindowTree& tree_request, WindowTreeClient client);
391 }; 406 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698