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

Unified Diff: content/common/input/touch_event_stream_validator.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 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
Index: content/common/input/touch_event_stream_validator.cc
diff --git a/content/common/input/touch_event_stream_validator.cc b/content/common/input/touch_event_stream_validator.cc
index 870f196e49f280ed7dfc83ef92d91a3404fc19c4..d13c7dc3a3fabe25e29eb8f0c3685c3dde4e506f 100644
--- a/content/common/input/touch_event_stream_validator.cc
+++ b/content/common/input/touch_event_stream_validator.cc
@@ -49,7 +49,7 @@ bool TouchEventStreamValidator::Validate(const WebTouchEvent& event,
error_msg->clear();
// TouchScrollStarted is not part of a regular touch event stream.
- if (event.type == WebInputEvent::TouchScrollStarted)
+ if (event.type() == WebInputEvent::TouchScrollStarted)
return true;
WebTouchEvent previous_event = previous_event_;
@@ -60,9 +60,9 @@ bool TouchEventStreamValidator::Validate(const WebTouchEvent& event,
return false;
}
- if (!WebInputEvent::isTouchEventType(event.type)) {
+ if (!WebInputEvent::isTouchEventType(event.type())) {
error_msg->append(StringPrintf("Touch event has invalid type: %s\n",
- WebInputEvent::GetName(event.type)));
+ WebInputEvent::GetName(event.type())));
}
// Allow "hard" restarting of touch stream validation. This is necessary
@@ -116,7 +116,7 @@ bool TouchEventStreamValidator::Validate(const WebTouchEvent& event,
break;
case WebTouchPoint::StateReleased:
- if (event.type != WebInputEvent::TouchEnd) {
+ if (event.type() != WebInputEvent::TouchEnd) {
error_msg->append(StringPrintf(
"Released touch point (id=%d) outside touchend.\n", point.id));
} else {
@@ -125,7 +125,7 @@ bool TouchEventStreamValidator::Validate(const WebTouchEvent& event,
break;
case WebTouchPoint::StatePressed:
- if (event.type != WebInputEvent::TouchStart) {
+ if (event.type() != WebInputEvent::TouchStart) {
error_msg->append(StringPrintf(
"Pressed touch point (id=%d) outside touchstart.\n", point.id));
} else {
@@ -134,7 +134,7 @@ bool TouchEventStreamValidator::Validate(const WebTouchEvent& event,
break;
case WebTouchPoint::StateMoved:
- if (event.type != WebInputEvent::TouchMove) {
+ if (event.type() != WebInputEvent::TouchMove) {
error_msg->append(StringPrintf(
"Moved touch point (id=%d) outside touchmove.\n", point.id));
} else {
@@ -146,7 +146,7 @@ bool TouchEventStreamValidator::Validate(const WebTouchEvent& event,
break;
case WebTouchPoint::StateCancelled:
- if (event.type != WebInputEvent::TouchCancel) {
+ if (event.type() != WebInputEvent::TouchCancel) {
error_msg->append(StringPrintf(
"Cancelled touch point (id=%d) outside touchcancel.\n",
point.id));
@@ -160,7 +160,7 @@ bool TouchEventStreamValidator::Validate(const WebTouchEvent& event,
if (!found_valid_state_for_type) {
error_msg->append(
StringPrintf("No valid touch point corresponding to event type: %s\n",
- WebInputEvent::GetName(event.type)));
+ WebInputEvent::GetName(event.type())));
}
return error_msg->empty();

Powered by Google App Engine
This is Rietveld 408576698