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

Side by Side Diff: components/mus/ws/event_dispatcher_delegate.h

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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/ws/event_dispatcher.cc ('k') | components/mus/ws/event_dispatcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_
6 #define COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_
7
8 #include <stdint.h>
9
10 #include "components/mus/common/types.h"
11
12 namespace gfx {
13 class Point;
14 }
15
16 namespace ui {
17 class Event;
18 }
19
20 namespace mus {
21 namespace ws {
22
23 class Accelerator;
24 class ServerWindow;
25
26 // Used by EventDispatcher for mocking in tests.
27 class EventDispatcherDelegate {
28 public:
29 virtual void OnAccelerator(uint32_t accelerator, const ui::Event& event) = 0;
30
31 virtual void SetFocusedWindowFromEventDispatcher(ServerWindow* window) = 0;
32 virtual ServerWindow* GetFocusedWindowForEventDispatcher() = 0;
33
34 // Called when capture should be set on the native display. |window| is the
35 // window capture is being set on.
36 virtual void SetNativeCapture(ServerWindow* window) = 0;
37 // Called when the native display is having capture released. There is no
38 // longer a ServerWindow holding capture.
39 virtual void ReleaseNativeCapture() = 0;
40 // Called when |window| has lost capture. The native display may still be
41 // holding capture. The delegate should not change native display capture.
42 // ReleaseNativeCapture() is invoked if appropriate.
43 virtual void OnServerWindowCaptureLost(ServerWindow* window) = 0;
44
45 virtual void OnMouseCursorLocationChanged(const gfx::Point& point) = 0;
46
47 // Dispatches an event to the specific client.
48 virtual void DispatchInputEventToWindow(ServerWindow* target,
49 ClientSpecificId client_id,
50 const ui::Event& event,
51 Accelerator* accelerator) = 0;
52
53 // Returns the id of the client to send events to. |in_nonclient_area| is
54 // true if the event occurred in the non-client area of the window.
55 virtual ClientSpecificId GetEventTargetClientId(const ServerWindow* window,
56 bool in_nonclient_area) = 0;
57
58 // Returns the window to start searching from at the specified location, or
59 // null if there is a no window containing |location|.
60 virtual ServerWindow* GetRootWindowContaining(const gfx::Point& location) = 0;
61
62 // Called when event dispatch could not find a target. OnAccelerator may still
63 // be called.
64 virtual void OnEventTargetNotFound(const ui::Event& event) = 0;
65
66 protected:
67 virtual ~EventDispatcherDelegate() {}
68 };
69
70 } // namespace ws
71 } // namespace mus
72
73 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_DELEGATE_H_
OLDNEW
« no previous file with comments | « components/mus/ws/event_dispatcher.cc ('k') | components/mus/ws/event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698