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

Unified 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: . 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 side-by-side diff with in-line comments
Download patch
Index: components/mus/public/interfaces/window_tree.mojom
diff --git a/components/mus/public/interfaces/window_tree.mojom b/components/mus/public/interfaces/window_tree.mojom
index eb2ef580ef31b7b8fb99e0eab0494d16f6976ed4..15eec8ca724d414da8083a18a97c0cad93773553 100644
--- a/components/mus/public/interfaces/window_tree.mojom
+++ b/components/mus/public/interfaces/window_tree.mojom
@@ -7,6 +7,7 @@ module mus.mojom;
import "components/mus/public/interfaces/compositor_frame.mojom";
import "components/mus/public/interfaces/cursor.mojom";
import "components/mus/public/interfaces/input_events.mojom";
+import "components/mus/public/interfaces/input_event_matcher.mojom";
import "components/mus/public/interfaces/mus_constants.mojom";
import "components/mus/public/interfaces/surface_id.mojom";
import "components/mus/public/interfaces/window_manager.mojom";
@@ -109,6 +110,13 @@ interface WindowTree {
// if |window_id| does not currently have capture.
ReleaseCapture(uint32 change_id, uint32 window_id);
+ // Sets an observer that monitors all events, even if they are not targeted
+ // at a window in this tree. If an event matchs |matcher| the observer reports
+ // it to the WindowTreeClient via OnEventObserved(). Each client may only have
+ // one observer at a time.
+ SetEventObserver(EventMatcher matcher);
sky 2016/04/21 17:23:03 Declare this as EventMatcher?, then you can pass i
James Cook 2016/04/22 18:22:54 Done.
+ ClearEventObserver();
+
// Sets the specified bounds of the specified window.
SetWindowBounds(uint32 change_id, uint32 window_id, mojo.Rect bounds);
@@ -362,6 +370,10 @@ interface WindowTreeClient {
// the event is ack'ed.
OnWindowInputEvent(uint32 event_id, uint32 window, Event event);
+ // Invoked when an event is sent via the EventObserver. Not targeted at a
+ // specific window. The client does not need to acknowledge these events.
+ OnEventObserved(Event event);
+
// Called in two distinct cases: when a window known to the connection gains
// focus, or when focus moves from a window known to the connection to a
// window not known to the connection. In the later case |focused_window_id|

Powered by Google App Engine
This is Rietveld 408576698