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

Unified Diff: components/mus/public/cpp/lib/event_matcher.cc

Issue 1527183003: Change mojo enums to be scoped enums in the generated C++ bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-equals
Patch Set: rebase Created 4 years, 11 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
« no previous file with comments | « components/mus/public/cpp/event_matcher.h ('k') | components/mus/public/cpp/lib/in_flight_change.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/lib/event_matcher.cc
diff --git a/components/mus/public/cpp/lib/event_matcher.cc b/components/mus/public/cpp/lib/event_matcher.cc
index 0c39714bef55ea6d9c76470d61392f4107a32c66..eeafcac04822ce3a769b5bbb07538d8446bc7bff 100644
--- a/components/mus/public/cpp/lib/event_matcher.cc
+++ b/components/mus/public/cpp/lib/event_matcher.cc
@@ -6,21 +6,19 @@
namespace mus {
-mojom::EventMatcherPtr CreateKeyMatcher(mojom::KeyboardCode code,
- mojom::EventFlags flags) {
+mojom::EventMatcherPtr CreateKeyMatcher(mojom::KeyboardCode code, int flags) {
mojom::EventMatcherPtr matcher(mojom::EventMatcher::New());
matcher->type_matcher = mojom::EventTypeMatcher::New();
matcher->flags_matcher = mojom::EventFlagsMatcher::New();
matcher->ignore_flags_matcher = mojom::EventFlagsMatcher::New();
// Ignoring these makes most accelerator scenarios more straight forward. Code
// that needs to check them can override this setting.
- matcher->ignore_flags_matcher->flags =
- static_cast<mojom::EventFlags>(mojom::EVENT_FLAGS_NUM_LOCK_ON |
- mojom::EVENT_FLAGS_CAPS_LOCK_ON |
- mojom::EVENT_FLAGS_SCROLL_LOCK_ON);
+ matcher->ignore_flags_matcher->flags = mojom::kEventFlagCapsLockOn |
+ mojom::kEventFlagScrollLockOn |
+ mojom::kEventFlagNumLockOn;
matcher->key_matcher = mojom::KeyEventMatcher::New();
- matcher->type_matcher->type = mus::mojom::EVENT_TYPE_KEY_PRESSED;
+ matcher->type_matcher->type = mus::mojom::EventType::KEY_PRESSED;
matcher->flags_matcher->flags = flags;
matcher->key_matcher->keyboard_code = code;
return matcher;
« no previous file with comments | « components/mus/public/cpp/event_matcher.h ('k') | components/mus/public/cpp/lib/in_flight_change.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698