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

Side by Side Diff: sky/engine/public/platform/WebInputEvent.h

Issue 866213004: Switch Sky to pointer events (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: nits Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 IsLastInputEventForCurrentVSync = 1 << 13, 180 IsLastInputEventForCurrentVSync = 1 << 13,
181 }; 181 };
182 182
183 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; 183 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey;
184 184
185 double timeStampSeconds; // Seconds since epoch. 185 double timeStampSeconds; // Seconds since epoch.
186 unsigned size; // The size of this structure, for serialization. 186 unsigned size; // The size of this structure, for serialization.
187 Type type; 187 Type type;
188 int modifiers; 188 int modifiers;
189 189
190 static bool isPointerEventType(int type)
191 {
192 return type == PointerDown ||
ojan 2015/01/23 10:23:55 Probably premature optimization, but we could save
abarth-chromium 2015/01/23 16:51:33 Ok. That's what the other similar functions do.
193 type == PointerMove ||
194 type == PointerUp ||
195 type == PointerCancel;
196 }
197
190 // Returns true if the WebInputEvent |type| is a mouse event. 198 // Returns true if the WebInputEvent |type| is a mouse event.
191 static bool isMouseEventType(int type) 199 static bool isMouseEventType(int type)
192 { 200 {
193 return MouseTypeFirst <= type && type <= MouseTypeLast; 201 return MouseTypeFirst <= type && type <= MouseTypeLast;
194 } 202 }
195 203
196 // Returns true if the WebInputEvent |type| is a keyboard event. 204 // Returns true if the WebInputEvent |type| is a keyboard event.
197 static bool isKeyboardEventType(int type) 205 static bool isKeyboardEventType(int type)
198 { 206 {
199 return KeyboardTypeFirst <= type && type <= KeyboardTypeLast; 207 return KeyboardTypeFirst <= type && type <= KeyboardTypeLast;
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 , cancelable(true) 557 , cancelable(true)
550 { 558 {
551 } 559 }
552 }; 560 };
553 561
554 #pragma pack(pop) 562 #pragma pack(pop)
555 563
556 } // namespace blink 564 } // namespace blink
557 565
558 #endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBINPUTEVENT_H_ 566 #endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBINPUTEVENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698