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

Unified Diff: ui/chromeos/touch_exploration_controller.cc

Issue 2880043002: Implement touch exploration touch typing (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « ui/chromeos/touch_exploration_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/chromeos/touch_exploration_controller.cc
diff --git a/ui/chromeos/touch_exploration_controller.cc b/ui/chromeos/touch_exploration_controller.cc
index 6fce4a307e29cec40ad781971561826bce3df3f9..0a624cd932963079d84858c0d4806be7e4d54450 100644
--- a/ui/chromeos/touch_exploration_controller.cc
+++ b/ui/chromeos/touch_exploration_controller.cc
@@ -72,6 +72,11 @@ void TouchExplorationController::SetExcludeBounds(const gfx::Rect& bounds) {
exclude_bounds_ = bounds;
}
+void TouchExplorationController::SetLiftActivationBounds(
+ const gfx::Rect& bounds) {
+ lift_activation_bounds_ = bounds;
+}
+
ui::EventRewriteStatus TouchExplorationController::RewriteEvent(
const ui::Event& event,
std::unique_ptr<ui::Event>* rewritten_event) {
@@ -473,6 +478,12 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploration(
} else if (type == ui::ET_TOUCH_RELEASED || type == ui::ET_TOUCH_CANCELLED) {
initial_press_.reset(new TouchEvent(event));
StartTapTimer();
+ if (!lift_activation_bounds_.IsEmpty()) {
+ gfx::Point location = event.location();
+ root_window_->GetHost()->ConvertScreenInPixelsToDIP(&location);
+ if (lift_activation_bounds_.Contains(location))
+ DispatchSynthesizedTap();
dmazzoni 2017/05/15 21:24:34 I think you'll want to call it from more than one
David Tseng 2017/05/16 16:07:34 Sending a click event maps to forceClickOnCurrentI
David Tseng 2017/05/16 16:07:34 Isn't a quick tap just pass through mode? i.e. it
+ }
SET_STATE(TOUCH_EXPLORE_RELEASED);
} else if (type != ui::ET_TOUCH_MOVED) {
NOTREACHED();
@@ -644,11 +655,13 @@ void TouchExplorationController::SendSimulatedClick() {
return;
}
- // If we don't have an anchor point, we can't send a simulated click.
+ DispatchSynthesizedTap();
+}
+
+void TouchExplorationController::DispatchSynthesizedTap() {
dmazzoni 2017/05/15 21:24:35 Rather than splitting SendSimulatedClick into two
David Tseng 2017/05/16 16:07:34 Ditto.
if (anchor_point_state_ == ANCHOR_POINT_NONE)
return;
- // Otherwise send a simulated press/release at the anchor point.
std::unique_ptr<ui::TouchEvent> touch_press;
touch_press.reset(new ui::TouchEvent(ui::ET_TOUCH_PRESSED, gfx::Point(),
Now(),
« no previous file with comments | « ui/chromeos/touch_exploration_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698