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

Side by Side Diff: components/mus/ws/event_matcher.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_unittest.cc ('k') | components/mus/ws/event_matcher.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 2016 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_MATCHER_H_
6 #define COMPONENTS_MUS_WS_EVENT_MATCHER_H_
7
8 #include <stdint.h>
9
10 #include "base/macros.h"
11 #include "components/mus/public/interfaces/event_matcher.mojom.h"
12 #include "ui/events/event.h"
13 #include "ui/events/mojo/event_constants.mojom.h"
14 #include "ui/events/mojo/keyboard_codes.mojom.h"
15 #include "ui/gfx/geometry/rect_f.h"
16
17 namespace mus {
18 namespace ws {
19
20 // Wraps a mojom::EventMatcher and allows events to be tested against it.
21 class EventMatcher {
22 public:
23 explicit EventMatcher(const mojom::EventMatcher& matcher);
24 ~EventMatcher();
25
26 bool MatchesEvent(const ui::Event& event) const;
27
28 bool Equals(const EventMatcher& other) const;
29
30 private:
31 enum MatchFields {
32 NONE = 0,
33 TYPE = 1 << 0,
34 FLAGS = 1 << 1,
35 KEYBOARD_CODE = 1 << 2,
36 POINTER_KIND = 1 << 3,
37 POINTER_LOCATION = 1 << 4,
38 };
39
40 uint32_t fields_to_match_;
41 ui::EventType event_type_;
42 // Bitfields of kEventFlag* and kMouseEventFlag* values in
43 // input_event_constants.mojom.
44 int event_flags_;
45 int ignore_event_flags_;
46 uint16_t keyboard_code_;
47 ui::EventPointerType pointer_type_;
48 gfx::RectF pointer_region_;
49
50 DISALLOW_COPY_AND_ASSIGN(EventMatcher);
51 };
52
53 } // namespace ws
54 } // namespace mus
55
56 #endif // COMPONENTS_MUS_WS_EVENT_MATCHER_H_
OLDNEW
« no previous file with comments | « components/mus/ws/event_dispatcher_unittest.cc ('k') | components/mus/ws/event_matcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698