Commit 4d14b4c6 authored by Kevin Schoedel's avatar Kevin Schoedel Committed by Commit Bot

[chromecast] Remove obsolete edge passthrough state.

Edge-passthrough was necessary in the past when the touch exploration
event rewriter preceded the cast system gesture event rewriter. Now
the touch exploration runs last, so this code is unused.

Bug: internal b/112073644
Test: manual
Change-Id: I3372a3ac15b31ac68b7d2a8603182f1e19a4934a
Reviewed-on: https://chromium-review.googlesource.com/1167545
Commit-Queue: Kevin Schoedel <kpschoedel@chromium.org>
Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582116}
parent 703024aa
......@@ -259,9 +259,6 @@ ui::EventRewriteStatus TouchExplorationController::RewriteEvent(
case TWO_FINGER_TAP:
status = InTwoFingerTap(touch_event_dip, rewritten_event);
break;
case EDGE_PASSTHROUGH:
status = InEdgePassthrough(touch_event_dip, rewritten_event);
break;
}
if (status == ui::EVENT_REWRITE_REWRITTEN) {
DCHECK(rewritten_event->get());
......@@ -302,8 +299,6 @@ ui::EventRewriteStatus TouchExplorationController::InNoFingersDown(
int edge = FindEdgesWithinInset(event.location(), kLeavingScreenEdge);
if (edge != NO_EDGE) {
accessibility_sound_player_->PlayEnterScreenEarcon();
SET_STATE(EDGE_PASSTHROUGH);
return ui::EVENT_REWRITE_CONTINUE;
}
}
......@@ -744,24 +739,6 @@ ui::EventRewriteStatus TouchExplorationController::InTwoFingerTap(
return ui::EVENT_REWRITE_DISCARD;
}
ui::EventRewriteStatus TouchExplorationController::InEdgePassthrough(
const ui::TouchEvent& event,
std::unique_ptr<ui::Event>* rewritten_event) {
if (current_touch_ids_.size() == 0) {
SET_STATE(NO_FINGERS_DOWN);
}
// |event| locations are in DIP; see |RewriteEvent|. We need to dispatch
// screen coordinates.
gfx::PointF location_f(ConvertDIPToScreenInPixels(event.location_f()));
std::unique_ptr<ui::TouchEvent> new_event(new ui::TouchEvent(
event.type(), gfx::Point(), event.time_stamp(), event.pointer_details()));
new_event->set_location_f(location_f);
new_event->set_root_location_f(location_f);
new_event->set_flags(event.flags());
*rewritten_event = std::move(new_event);
return ui::EVENT_REWRITE_REWRITTEN;
}
base::TimeTicks TouchExplorationController::Now() {
return ui::EventTimeForNow();
}
......@@ -1086,7 +1063,6 @@ void TouchExplorationController::SetState(State new_state,
case ONE_FINGER_PASSTHROUGH:
case CORNER_PASSTHROUGH:
case WAIT_FOR_NO_FINGERS:
case EDGE_PASSTHROUGH:
if (gesture_provider_.get())
gesture_provider_.reset(NULL);
max_gesture_touch_points_ = 0;
......@@ -1170,8 +1146,6 @@ const char* TouchExplorationController::EnumStateToString(State state) {
return "WAIT_FOR_NO_FINGERS";
case TWO_FINGER_TAP:
return "TWO_FINGER_TAP";
case EDGE_PASSTHROUGH:
return "EDGE_PASSTHROUGH";
}
return "Not a state";
}
......
......@@ -224,9 +224,6 @@ class TouchExplorationController : public ui::EventRewriter,
ui::EventRewriteStatus InTwoFingerTap(
const ui::TouchEvent& event,
std::unique_ptr<ui::Event>* rewritten_event);
ui::EventRewriteStatus InEdgePassthrough(
const ui::TouchEvent& event,
std::unique_ptr<ui::Event>* rewritten_event);
// Returns the current time of the tick clock.
base::TimeTicks Now();
......@@ -388,10 +385,6 @@ class TouchExplorationController : public ui::EventRewriter,
// If the user taps the screen with two fingers and releases both fingers
// before the grace period has passed, spoken feedback will be silenced.
TWO_FINGER_TAP,
// If the user enters the screen from the edge, pass events through,
// so that they are available to the system gesture handler.
EDGE_PASSTHROUGH,
};
enum AnchorPointState {
......
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