Commit 63a7666b authored by Ryan Daum's avatar Ryan Daum Committed by Commit Bot

[chromecast] Use touch presses for onTapDownGesture

  * Some applications (such as maps) seem to disable gesture
    recognition, leading to a situation where onGestureEvent is never
    being called with ET_GESTURE_TAP_DOWN.
  * This led to applications timing out and returning to the home
    screen despite the user performing activity on the screen.
  * This CL treats a touch press event as a 'tap down', without
    requiring a GestureEvent.

Bug: internal b/113205924
Test: manual on device
Change-Id: I0bfa1bc8c2bd8685ae41de527f2b79477b176a3e
Reviewed-on: https://chromium-review.googlesource.com/1214329Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: Ryan Daum <rdaum@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589787}
parent 18b8d9c4
......@@ -34,26 +34,15 @@ CastSystemGestureEventHandler::~CastSystemGestureEventHandler() {
root_window_->RemovePreTargetHandler(this);
}
void CastSystemGestureEventHandler::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP ||
event->type() == ui::ET_GESTURE_TAP_DOWN) {
ProcessPressedEvent(event);
void CastSystemGestureEventHandler::OnTouchEvent(ui::TouchEvent* event) {
if (event->type() == ui::ET_TOUCH_PRESSED) {
dispatcher_->HandleTapDownGesture(event->location());
}
}
void CastSystemGestureEventHandler::ProcessPressedEvent(
ui::GestureEvent* event) {
gfx::Point touch_location(event->location());
// Let the subscriber know about the gesture begin.
switch (event->type()) {
case ui::ET_GESTURE_TAP_DOWN:
dispatcher_->HandleTapDownGesture(touch_location);
break;
case ui::ET_GESTURE_TAP:
dispatcher_->HandleTapGesture(touch_location);
break;
default:
return;
void CastSystemGestureEventHandler::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP) {
dispatcher_->HandleTapGesture(event->location());
}
}
......
......@@ -26,11 +26,10 @@ class CastSystemGestureEventHandler : public ui::EventHandler {
~CastSystemGestureEventHandler() override;
// ui::EventHandler implementation.
void OnTouchEvent(ui::TouchEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
private:
void ProcessPressedEvent(ui::GestureEvent* event);
CastSystemGestureDispatcher* dispatcher_;
aura::Window* root_window_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment