This source file includes following definitions.
- AllTouchPointsHaveState
- IsTouchSequenceStart
#include "content/browser/renderer_host/input/web_touch_event_traits.h"
#include "base/logging.h"
using blink::WebInputEvent;
using blink::WebTouchEvent;
namespace content {
namespace {
bool AllTouchPointsHaveState(const WebTouchEvent& event,
blink::WebTouchPoint::State state) {
if(!event.touchesLength)
return false;
for (size_t i = 0; i < event.touchesLength; ++i) {
if (event.touches[i].state != state)
return false;
}
return true;
}
}
bool WebTouchEventTraits::IsTouchSequenceStart(const WebTouchEvent& event) {
DCHECK(event.touchesLength);
if (event.type != WebInputEvent::TouchStart)
return false;
return AllTouchPointsHaveState(event, blink::WebTouchPoint::StatePressed);
}
}