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

Unified Diff: ui/chromeos/touch_exploration_controller.cc

Issue 1407133008: chromeos: Remove implicit Point to PointF conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-chromeos: . Created 5 years, 2 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 4fdd821ddfc10bd59aaecd520fe2dd6773281fa6..5661d1d13fffe7ae9dcfc37f416d1e0ab479ba18 100644
--- a/ui/chromeos/touch_exploration_controller.cc
+++ b/ui/chromeos/touch_exploration_controller.cc
@@ -365,17 +365,14 @@ ui::EventRewriteStatus TouchExplorationController::InDoubleTapPending(
return EVENT_REWRITE_DISCARD;
scoped_ptr<ui::TouchEvent> touch_press;
- touch_press.reset(new ui::TouchEvent(ui::ET_TOUCH_PRESSED,
- last_touch_exploration_->location(),
- initial_press_->touch_id(),
- event.time_stamp()));
+ touch_press.reset(new ui::TouchEvent(
+ ui::ET_TOUCH_PRESSED, last_touch_exploration_->location_f(),
+ initial_press_->touch_id(), event.time_stamp()));
DispatchEvent(touch_press.get());
- rewritten_event->reset(
- new ui::TouchEvent(ui::ET_TOUCH_RELEASED,
- last_touch_exploration_->location(),
- initial_press_->touch_id(),
- event.time_stamp()));
+ rewritten_event->reset(new ui::TouchEvent(
+ ui::ET_TOUCH_RELEASED, last_touch_exploration_->location_f(),
+ initial_press_->touch_id(), event.time_stamp()));
(*rewritten_event)->set_flags(event.flags());
SET_STATE(NO_FINGERS_DOWN);
return ui::EVENT_REWRITE_REWRITTEN;
@@ -394,11 +391,9 @@ ui::EventRewriteStatus TouchExplorationController::InTouchReleasePending(
if (current_touch_ids_.size() != 0)
return EVENT_REWRITE_DISCARD;
- rewritten_event->reset(
- new ui::TouchEvent(ui::ET_TOUCH_RELEASED,
- last_touch_exploration_->location(),
- initial_press_->touch_id(),
- event.time_stamp()));
+ rewritten_event->reset(new ui::TouchEvent(
+ ui::ET_TOUCH_RELEASED, last_touch_exploration_->location_f(),
+ initial_press_->touch_id(), event.time_stamp()));
(*rewritten_event)->set_flags(event.flags());
SET_STATE(NO_FINGERS_DOWN);
return ui::EVENT_REWRITE_REWRITTEN;
@@ -415,11 +410,9 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploration(
// Handle split-tap.
initial_press_.reset(new TouchEvent(event));
tap_timer_.Stop();
- rewritten_event->reset(
- new ui::TouchEvent(ui::ET_TOUCH_PRESSED,
- last_touch_exploration_->location(),
- event.touch_id(),
- event.time_stamp()));
+ rewritten_event->reset(new ui::TouchEvent(
+ ui::ET_TOUCH_PRESSED, last_touch_exploration_->location_f(),
+ event.touch_id(), event.time_stamp()));
(*rewritten_event)->set_flags(event.flags());
SET_STATE(TOUCH_EXPLORE_SECOND_PRESS);
return ui::EVENT_REWRITE_REWRITTEN;
@@ -433,7 +426,7 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploration(
}
// Rewrite as a mouse-move event.
- *rewritten_event = CreateMouseMoveEvent(event.location(), event.flags());
+ *rewritten_event = CreateMouseMoveEvent(event.location_f(), event.flags());
last_touch_exploration_.reset(new TouchEvent(event));
return ui::EVENT_REWRITE_REWRITTEN;
}
@@ -473,7 +466,7 @@ ui::EventRewriteStatus TouchExplorationController::InCornerPassthrough(
}
rewritten_event->reset(new ui::TouchEvent(
- type, event.location(), event.touch_id(), event.time_stamp()));
+ type, event.location_f(), event.touch_id(), event.time_stamp()));
(*rewritten_event)->set_flags(event.flags());
if (current_touch_ids_.size() == 0)
@@ -492,10 +485,8 @@ ui::EventRewriteStatus TouchExplorationController::InOneFingerPassthrough(
return ui::EVENT_REWRITE_DISCARD;
}
rewritten_event->reset(
- new ui::TouchEvent(event.type(),
- event.location() - passthrough_offset_,
- event.touch_id(),
- event.time_stamp()));
+ new ui::TouchEvent(event.type(), event.location_f() - passthrough_offset_,
+ event.touch_id(), event.time_stamp()));
(*rewritten_event)->set_flags(event.flags());
if (current_touch_ids_.size() == 0) {
@@ -514,11 +505,9 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploreSecondPress(
// through. The user enters the wait state, Since there has already been
// a press dispatched when split tap began, the touch needs to be
// cancelled.
- rewritten_event->reset(
- new ui::TouchEvent(ui::ET_TOUCH_CANCELLED,
- last_touch_exploration_->location(),
- initial_press_->touch_id(),
- event.time_stamp()));
+ rewritten_event->reset(new ui::TouchEvent(
+ ui::ET_TOUCH_CANCELLED, last_touch_exploration_->location_f(),
+ initial_press_->touch_id(), event.time_stamp()));
(*rewritten_event)->set_flags(event.flags());
SET_STATE(WAIT_FOR_NO_FINGERS);
return ui::EVENT_REWRITE_REWRITTEN;
@@ -540,13 +529,11 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploreSecondPress(
// fingers in place is a bit harder. If the user has left the slop, the
// split tap press (which was previous dispatched) is lifted with a touch
// cancelled, and the user enters the wait state.
- if ((event.location() - original_touch->location()).Length() >
+ if ((event.location_f() - original_touch->location_f()).Length() >
GetSplitTapTouchSlop()) {
- rewritten_event->reset(
- new ui::TouchEvent(ui::ET_TOUCH_CANCELLED,
- last_touch_exploration_->location(),
- initial_press_->touch_id(),
- event.time_stamp()));
+ rewritten_event->reset(new ui::TouchEvent(
+ ui::ET_TOUCH_CANCELLED, last_touch_exploration_->location_f(),
+ initial_press_->touch_id(), event.time_stamp()));
(*rewritten_event)->set_flags(event.flags());
SET_STATE(WAIT_FOR_NO_FINGERS);
return ui::EVENT_REWRITE_REWRITTEN;
@@ -567,11 +554,9 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploreSecondPress(
return EVENT_REWRITE_DISCARD;
// Rewrite at location of last touch exploration.
- rewritten_event->reset(
- new ui::TouchEvent(ui::ET_TOUCH_RELEASED,
- last_touch_exploration_->location(),
- initial_press_->touch_id(),
- event.time_stamp()));
+ rewritten_event->reset(new ui::TouchEvent(
+ ui::ET_TOUCH_RELEASED, last_touch_exploration_->location_f(),
+ initial_press_->touch_id(), event.time_stamp()));
(*rewritten_event)->set_flags(event.flags());
SET_STATE(TOUCH_EXPLORATION);
EnterTouchToMouseMode();
@@ -705,13 +690,11 @@ void TouchExplorationController::OnTapTimerFired() {
return;
case DOUBLE_TAP_PENDING: {
SET_STATE(ONE_FINGER_PASSTHROUGH);
- passthrough_offset_ = last_unused_finger_event_->location() -
- last_touch_exploration_->location();
- scoped_ptr<ui::TouchEvent> passthrough_press(
- new ui::TouchEvent(ui::ET_TOUCH_PRESSED,
- last_touch_exploration_->location(),
- last_unused_finger_event_->touch_id(),
- Now()));
+ passthrough_offset_ = last_unused_finger_event_->location_f() -
+ last_touch_exploration_->location_f();
+ scoped_ptr<ui::TouchEvent> passthrough_press(new ui::TouchEvent(
+ ui::ET_TOUCH_PRESSED, last_touch_exploration_->location_f(),
+ last_unused_finger_event_->touch_id(), Now()));
DispatchEvent(passthrough_press.get());
return;
}
@@ -735,8 +718,8 @@ void TouchExplorationController::OnTapTimerFired() {
return;
}
EnterTouchToMouseMode();
- scoped_ptr<ui::Event> mouse_move =
- CreateMouseMoveEvent(initial_press_->location(), initial_press_->flags());
+ scoped_ptr<ui::Event> mouse_move = CreateMouseMoveEvent(
+ initial_press_->location_f(), initial_press_->flags());
DispatchEvent(mouse_move.get());
last_touch_exploration_.reset(new TouchEvent(*initial_press_));
}
« 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