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

Unified Diff: ui/events/event_utils.cc

Issue 2540433002: Reland "Propagate information about how ARC apps are launched" (Closed)
Patch Set: Fixed unit tests Created 4 years, 1 month 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 | « ui/events/event_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event_utils.cc
diff --git a/ui/events/event_utils.cc b/ui/events/event_utils.cc
index dd0da3424eddb5f122ca202ed567f6b833384470..0c9a54da36e309f5327fd3fb7c453101d029053b 100644
--- a/ui/events/event_utils.cc
+++ b/ui/events/event_utils.cc
@@ -19,7 +19,7 @@ int g_custom_event_types = ET_LAST;
std::unique_ptr<Event> EventFromNative(const base::NativeEvent& native_event) {
std::unique_ptr<Event> event;
EventType type = EventTypeFromNative(native_event);
- switch(type) {
+ switch (type) {
case ET_KEY_PRESSED:
case ET_KEY_RELEASED:
event.reset(new KeyEvent(native_event));
@@ -130,4 +130,14 @@ void ComputeEventLatencyOS(const base::NativeEvent& native_event) {
}
}
+bool IsMouseEventFromFlags(int event_flags) {
sky 2016/11/28 21:35:26 AFAICT these functions are only used in your code.
Luis Héctor Chávez 2016/11/28 21:55:05 Done.
+ return (event_flags & (EF_LEFT_MOUSE_BUTTON | EF_MIDDLE_MOUSE_BUTTON |
+ EF_RIGHT_MOUSE_BUTTON | EF_BACK_MOUSE_BUTTON |
+ EF_FORWARD_MOUSE_BUTTON)) != 0;
+}
+
+bool IsTouchEventFromFlags(int event_flags) {
+ return (event_flags & EF_FROM_TOUCH) != 0;
+}
+
} // namespace ui
« no previous file with comments | « ui/events/event_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698