Change definitions of EventPointerType.
Change the name definitions, replacing the old style. POINTER_TYPE_XXX -> kXXX Done via sed. This change will allow us to only have a single definition in UI/blink, currently there are 3 definitions of the same value. No functional changes in this CL. BUG=1073560 TBR=sky@chromium.org Change-Id: I20be33b33c0689b720e00d2cfa86a43f145ae808 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2170856 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org> Cr-Commit-Position: refs/heads/master@{#763831}
This commit is contained in:
ash
accessibility
app_list
display
drag_drop
events
fast_ink
magnifier
metrics
shelf
system
touch
utility
wm
chrome/browser
chromeos
accessibility
events
power
ui
views
fullscreen_control
chromecast
browser
graphics
components/exo
content
browser
renderer_host
input
render_widget_host_view_aura.ccrender_widget_host_view_aura.hrender_widget_host_view_aura_unittest.ccui_events_helper.ccweb_contents
public
ui
aura
base
user_activity
events
blink
cocoa
devices
event.hevent_constants.hevent_unittest.ccevents_stub.ccfuchsia
gesture_detection
gesture_event_details.hgestures
gesture_provider_aura.ccgesture_provider_aura_unittest.ccgesture_recognizer_impl.ccmotion_event_aura.ccmotion_event_aura_unittest.cc
mojom
ozone
evdev
test
win
x
ozone
platform
wayland
host
views
animation
controls
touchui
widget
win
wm
@ -1149,9 +1149,8 @@ gfx::PointF TouchExplorationController::ConvertDIPToPixels(
|
||||
bool TouchExplorationController::IsTargetedToArcVirtualKeyboard(
|
||||
const gfx::Point& location) {
|
||||
// Copy event here as WindowTargeter::FindTargetForEvent modify touch event.
|
||||
ui::TouchEvent event(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent event(ui::ET_TOUCH_MOVED, gfx::Point(), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
event.set_location(location);
|
||||
|
||||
// It's safe to static cast to aura::Window here. As current implementation of
|
||||
|
@ -297,7 +297,7 @@ class TouchExplorationTest : public aura::test::AuraTestBase {
|
||||
void EnterTouchExplorationModeAtLocation(gfx::Point tap_location) {
|
||||
ui::TouchEvent touch_press(
|
||||
ui::ET_TOUCH_PRESSED, tap_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&touch_press);
|
||||
AdvanceSimulatedTimePastTapDelay();
|
||||
EXPECT_TRUE(IsInTouchToMouseMode());
|
||||
@ -523,7 +523,7 @@ TEST_F(TouchExplorationTest, TurnOnMidTouch) {
|
||||
SwitchTouchExplorationMode(true);
|
||||
ui::TouchEvent touch_move(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(11, 12), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&touch_move);
|
||||
EXPECT_TRUE(cursor_client()->IsCursorVisible());
|
||||
EXPECT_FALSE(cursor_client()->IsMouseEventsEnabled());
|
||||
@ -550,7 +550,7 @@ TEST_F(TouchExplorationTest, TurnOnMidTouch) {
|
||||
// The release of the first finger shouldn't be affected.
|
||||
ui::TouchEvent touch_release(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(11, 12), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&touch_release);
|
||||
captured_events = GetCapturedLocatedEvents();
|
||||
ASSERT_EQ(1u, captured_events.size());
|
||||
@ -979,7 +979,7 @@ TEST_F(TouchExplorationTest, SplitTap) {
|
||||
// After the release, there is still a finger in touch explore mode.
|
||||
ui::TouchEvent split_tap_press(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press);
|
||||
// To simulate the behavior of the real device, we manually disable
|
||||
// mouse events. To not rely on manually setting the state, this is also
|
||||
@ -990,7 +990,7 @@ TEST_F(TouchExplorationTest, SplitTap) {
|
||||
EXPECT_FALSE(IsInGestureInProgressState());
|
||||
ui::TouchEvent split_tap_release(
|
||||
ui::ET_TOUCH_RELEASED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_release);
|
||||
// Releasing the second finger should re-enable mouse events putting us
|
||||
// back into the touch exploration mode.
|
||||
@ -1009,7 +1009,7 @@ TEST_F(TouchExplorationTest, SplitTap) {
|
||||
|
||||
ui::TouchEvent touch_explore_release(
|
||||
ui::ET_TOUCH_RELEASED, initial_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&touch_explore_release);
|
||||
AdvanceSimulatedTimePastTapDelay();
|
||||
EXPECT_TRUE(IsInNoFingersDownState());
|
||||
@ -1040,15 +1040,15 @@ TEST_F(TouchExplorationTest, SplitTapRelease) {
|
||||
// not at the location of the second tap and release.
|
||||
ui::TouchEvent split_tap_press(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press);
|
||||
ui::TouchEvent touch_explore_release(
|
||||
ui::ET_TOUCH_RELEASED, initial_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&touch_explore_release);
|
||||
ui::TouchEvent split_tap_release(
|
||||
ui::ET_TOUCH_RELEASED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_release);
|
||||
EXPECT_TRUE(IsInNoFingersDownState());
|
||||
|
||||
@ -1083,7 +1083,7 @@ TEST_F(TouchExplorationTest, SplitTapMultiFinger) {
|
||||
// Now tap at a different location
|
||||
ui::TouchEvent split_tap_press(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press);
|
||||
simulated_clock_.Advance(gesture_detector_config_.longpress_timeout);
|
||||
|
||||
@ -1091,22 +1091,22 @@ TEST_F(TouchExplorationTest, SplitTapMultiFinger) {
|
||||
// enter the wait state.
|
||||
ui::TouchEvent third_press(
|
||||
ui::ET_TOUCH_PRESSED, third_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
generator_->Dispatch(&third_press);
|
||||
|
||||
// When all three fingers are released, no events should be captured.
|
||||
// All fingers should then be up.
|
||||
ui::TouchEvent touch_explore_release(
|
||||
ui::ET_TOUCH_RELEASED, initial_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&touch_explore_release);
|
||||
ui::TouchEvent split_tap_release(
|
||||
ui::ET_TOUCH_RELEASED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_release);
|
||||
ui::TouchEvent third_tap_release(
|
||||
ui::ET_TOUCH_RELEASED, third_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
generator_->Dispatch(&third_tap_release);
|
||||
|
||||
std::vector<ui::LocatedEvent*> captured_events = GetCapturedLocatedEvents();
|
||||
@ -1132,22 +1132,22 @@ TEST_F(TouchExplorationTest, SplitTapLeaveSlop) {
|
||||
// Now tap at a different location for split tap.
|
||||
ui::TouchEvent split_tap_press(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press);
|
||||
|
||||
// Move the first finger out of slop and release both fingers. The split
|
||||
// tap should have been cancelled.
|
||||
ui::TouchEvent first_touch_move(
|
||||
ui::ET_TOUCH_MOVED, first_move_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_touch_move);
|
||||
ui::TouchEvent first_touch_release(
|
||||
ui::ET_TOUCH_RELEASED, first_move_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_touch_release);
|
||||
ui::TouchEvent second_touch_release(
|
||||
ui::ET_TOUCH_RELEASED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&second_touch_release);
|
||||
|
||||
std::vector<ui::LocatedEvent*> captured_events = GetCapturedLocatedEvents();
|
||||
@ -1159,22 +1159,22 @@ TEST_F(TouchExplorationTest, SplitTapLeaveSlop) {
|
||||
ClearCapturedEvents();
|
||||
ui::TouchEvent split_tap_press2(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press2);
|
||||
|
||||
// Move the second finger out of slop and release both fingers. The split
|
||||
// tap should have been cancelled.
|
||||
ui::TouchEvent second_touch_move2(
|
||||
ui::ET_TOUCH_MOVED, second_move_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&second_touch_move2);
|
||||
ui::TouchEvent first_touch_release2(
|
||||
ui::ET_TOUCH_RELEASED, first_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_touch_release2);
|
||||
ui::TouchEvent second_touch_release2(
|
||||
ui::ET_TOUCH_RELEASED, second_move_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&second_touch_release2);
|
||||
|
||||
captured_events = GetCapturedLocatedEvents();
|
||||
@ -1194,7 +1194,7 @@ TEST_F(TouchExplorationTest, EnterGestureInProgressState) {
|
||||
float distance = gesture_detector_config_.touch_slop + 1;
|
||||
ui::TouchEvent first_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(0, 1), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
gfx::Point second_location(distance / 2, 1);
|
||||
gfx::Point third_location(distance, 1);
|
||||
gfx::Point touch_exploration_location(20, 21);
|
||||
@ -1371,18 +1371,15 @@ TEST_F(TouchExplorationTest, DISABLED_AllFingerPermutations) {
|
||||
int y = 10 * touch_id + 2;
|
||||
all_events.push_back(std::make_unique<ui::TouchEvent>(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(x++, y++), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
touch_id)));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, touch_id)));
|
||||
queued_events.push_back(all_events.back().get());
|
||||
all_events.push_back(std::make_unique<ui::TouchEvent>(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(x++, y++), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
touch_id)));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, touch_id)));
|
||||
queued_events.push_back(all_events.back().get());
|
||||
all_events.push_back(std::make_unique<ui::TouchEvent>(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(x, y), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
touch_id)));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, touch_id)));
|
||||
queued_events.push_back(all_events.back().get());
|
||||
}
|
||||
|
||||
@ -1487,7 +1484,7 @@ TEST_F(TouchExplorationTest, GestureAddedFinger) {
|
||||
float distance = gesture_detector_config_.touch_slop + 1;
|
||||
ui::TouchEvent first_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_press);
|
||||
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
|
||||
gfx::Point second_location(100 + distance, 200);
|
||||
@ -1501,7 +1498,7 @@ TEST_F(TouchExplorationTest, GestureAddedFinger) {
|
||||
// gestures are prevented from continuing to go through.
|
||||
ui::TouchEvent second_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(20, 21), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&second_press);
|
||||
AdvanceSimulatedTimePastTapDelay();
|
||||
EXPECT_FALSE(IsInGestureInProgressState());
|
||||
@ -1518,7 +1515,7 @@ TEST_F(TouchExplorationTest, EnterSlideGestureState) {
|
||||
float distance = gesture_detector_config_.touch_slop + 1;
|
||||
ui::TouchEvent first_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(window_right, 1), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
gfx::Point second_location(window_right, 1 + distance / 2);
|
||||
gfx::Point third_location(window_right, 1 + distance);
|
||||
gfx::Point fourth_location(window_right, 35);
|
||||
@ -1578,7 +1575,7 @@ TEST_F(TouchExplorationTest, AvoidEnteringSlideGesture) {
|
||||
ui::TouchEvent first_press(
|
||||
ui::ET_TOUCH_PRESSED,
|
||||
gfx::Point(window.right() - GetSlopDistanceFromEdge(), 1), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
gfx::Point out_of_slop(window.right() - GetSlopDistanceFromEdge() + distance,
|
||||
1);
|
||||
gfx::Point into_boundaries(window.right() - GetMaxDistanceFromEdge() / 2, 1);
|
||||
@ -1619,7 +1616,7 @@ TEST_F(TouchExplorationTest, TestingBoundaries) {
|
||||
|
||||
ui::TouchEvent first_press(
|
||||
ui::ET_TOUCH_PRESSED, initial_press, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_press);
|
||||
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
|
||||
EXPECT_FALSE(IsInGestureInProgressState());
|
||||
@ -1696,7 +1693,7 @@ TEST_F(TouchExplorationTest, InBoundariesTouchExploration) {
|
||||
gfx::Point initial_press(window.right() - GetMaxDistanceFromEdge() / 2, 1);
|
||||
ui::TouchEvent first_press(
|
||||
ui::ET_TOUCH_PRESSED, initial_press, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_press);
|
||||
EXPECT_FALSE(IsInGestureInProgressState());
|
||||
EXPECT_FALSE(IsInSlideGestureState());
|
||||
@ -1760,24 +1757,24 @@ TEST_F(TouchExplorationTest, TwoFingerTapAndMoveFirstFinger) {
|
||||
// tap.
|
||||
ui::TouchEvent first_press_id_1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent first_press_id_2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(110, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
|
||||
ui::TouchEvent slop_move_id_1(
|
||||
ui::ET_TOUCH_MOVED,
|
||||
gfx::Point(100 + gesture_detector_config_.touch_slop, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent slop_move_id_2(
|
||||
ui::ET_TOUCH_MOVED,
|
||||
gfx::Point(110 + gesture_detector_config_.touch_slop, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
|
||||
ui::TouchEvent out_slop_id_1(
|
||||
ui::ET_TOUCH_MOVED,
|
||||
gfx::Point(100 + gesture_detector_config_.touch_slop + 1, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
// Dispatch the inital presses.
|
||||
generator_->Dispatch(&first_press_id_1);
|
||||
@ -1810,15 +1807,15 @@ TEST_F(TouchExplorationTest, TwoFingerTapAndMoveSecondFinger) {
|
||||
// tap.
|
||||
ui::TouchEvent first_press_id_1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent first_press_id_2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(110, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
|
||||
ui::TouchEvent out_slop_id_2(
|
||||
ui::ET_TOUCH_MOVED,
|
||||
gfx::Point(100 + gesture_detector_config_.touch_slop + 1, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
generator_->Dispatch(&first_press_id_1);
|
||||
EXPECT_FALSE(IsInTwoFingerTapState());
|
||||
@ -1965,7 +1962,7 @@ TEST_F(TouchExplorationTest, TouchExploreLiftInLiftActivationArea) {
|
||||
// A touch release should trigger a tap.
|
||||
ui::TouchEvent touch_explore_release(
|
||||
ui::ET_TOUCH_RELEASED, tap_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&touch_explore_release);
|
||||
AdvanceSimulatedTimePastTapDelay();
|
||||
|
||||
@ -1985,7 +1982,7 @@ TEST_F(TouchExplorationTest, TouchExploreLiftInLiftActivationArea) {
|
||||
ClearCapturedEvents();
|
||||
ui::TouchEvent out_touch_explore_release(
|
||||
ui::ET_TOUCH_RELEASED, out_tap_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&out_touch_explore_release);
|
||||
AdvanceSimulatedTimePastTapDelay();
|
||||
|
||||
@ -2014,28 +2011,28 @@ TEST_F(TouchExplorationTest, ThreeOrFourFingerTap) {
|
||||
|
||||
ui::TouchEvent press_id_1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent release_id_1(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent press_id_2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(110, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
ui::TouchEvent release_id_2(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(110, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
ui::TouchEvent press_id_3(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(120, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 3));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 3));
|
||||
ui::TouchEvent release_id_3(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(120, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 3));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 3));
|
||||
ui::TouchEvent press_id_4(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(130, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 4));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 4));
|
||||
ui::TouchEvent release_id_4(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(120, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 4));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 4));
|
||||
|
||||
// Three fingers down.
|
||||
generator_->Dispatch(&press_id_1);
|
||||
|
@ -1404,9 +1404,9 @@ TEST_P(AppListPresenterDelegateTest, LongPressOutsideCloseAppList) {
|
||||
outside_point.Offset(0, -10);
|
||||
|
||||
// Dispatch LONG_PRESS to AppListPresenterDelegate.
|
||||
ui::TouchEvent long_press(
|
||||
ui::ET_GESTURE_LONG_PRESS, outside_point, base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH));
|
||||
ui::TouchEvent long_press(ui::ET_GESTURE_LONG_PRESS, outside_point,
|
||||
base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch));
|
||||
GetEventGenerator()->Dispatch(&long_press);
|
||||
GetAppListTestHelper()->WaitUntilIdle();
|
||||
GetAppListTestHelper()->CheckVisibility(false);
|
||||
@ -1423,7 +1423,7 @@ TEST_P(AppListPresenterDelegateTest, TwoFingerTapOutsideCloseAppList) {
|
||||
// Dispatch TWO_FINGER_TAP to AppListPresenterDelegate.
|
||||
ui::TouchEvent two_finger_tap(
|
||||
ui::ET_GESTURE_TWO_FINGER_TAP, outside_point, base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch));
|
||||
GetEventGenerator()->Dispatch(&two_finger_tap);
|
||||
GetAppListTestHelper()->WaitUntilIdle();
|
||||
GetAppListTestHelper()->CheckVisibility(false);
|
||||
|
@ -148,13 +148,11 @@ class TouchCalibratorControllerTest : public AshTestBase {
|
||||
|
||||
ui::TouchEvent press_touch_event(
|
||||
ui::ET_TOUCH_PRESSED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 12, 1.0f,
|
||||
1.0f, 0.0f),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 12, 1.0f, 1.0f, 0.0f),
|
||||
0);
|
||||
ui::TouchEvent release_touch_event(
|
||||
ui::ET_TOUCH_RELEASED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 12, 1.0f,
|
||||
1.0f, 0.0f),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 12, 1.0f, 1.0f, 0.0f),
|
||||
0);
|
||||
|
||||
press_touch_event.set_source_device_id(touch_device_id);
|
||||
|
@ -1146,28 +1146,24 @@ TEST_F(DragDropControllerTest, TouchDragDropCompletesOnFling) {
|
||||
gfx::Point end = start + gfx::Vector2d(drag_view->bounds().width() / 3, 0);
|
||||
|
||||
base::TimeTicks timestamp = ui::EventTimeForNow();
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, start, timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, start, timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator.Dispatch(&press);
|
||||
|
||||
DispatchGesture(ui::ET_GESTURE_LONG_PRESS, start);
|
||||
UpdateDragData();
|
||||
timestamp += base::TimeDelta::FromMilliseconds(10);
|
||||
ui::TouchEvent move1(
|
||||
ui::ET_TOUCH_MOVED, mid, timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move1(ui::ET_TOUCH_MOVED, mid, timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator.Dispatch(&move1);
|
||||
// Doing two moves instead of one will guarantee to generate a fling at the
|
||||
// end.
|
||||
timestamp += base::TimeDelta::FromMilliseconds(10);
|
||||
ui::TouchEvent move2(
|
||||
ui::ET_TOUCH_MOVED, end, timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move2(ui::ET_TOUCH_MOVED, end, timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator.Dispatch(&move2);
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, end, timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, end, timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator.Dispatch(&release);
|
||||
|
||||
EXPECT_TRUE(drag_drop_controller_->drag_start_received_);
|
||||
|
@ -43,7 +43,7 @@ void SelectToSpeakEventHandler::SetSelectToSpeakStateSelecting(
|
||||
if (state_ != MOUSE_RELEASED)
|
||||
state_ = INACTIVE;
|
||||
touch_id_ = ui::kPointerIdUnknown;
|
||||
touch_type_ = ui::EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
touch_type_ = ui::EventPointerType::kUnknown;
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ void SelectToSpeakEventHandler::OnTouchEvent(ui::TouchEvent* event) {
|
||||
state_ == CAPTURING_TOUCH_ONLY) {
|
||||
state_ = INACTIVE;
|
||||
touch_id_ = ui::kPointerIdUnknown;
|
||||
touch_type_ = ui::EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
touch_type_ = ui::EventPointerType::kUnknown;
|
||||
}
|
||||
|
||||
// Create a mouse event to send to the extension, describing the touch.
|
||||
|
@ -99,7 +99,7 @@ class ASH_EXPORT SelectToSpeakEventHandler : public ui::EventHandler {
|
||||
|
||||
ui::PointerId touch_id_ = ui::kPointerIdUnknown;
|
||||
|
||||
ui::EventPointerType touch_type_ = ui::EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
ui::EventPointerType touch_type_ = ui::EventPointerType::kUnknown;
|
||||
|
||||
// The delegate used to send key events to the Select-to-Speak extension.
|
||||
SelectToSpeakEventHandlerDelegate* delegate_;
|
||||
|
@ -45,8 +45,7 @@ void FastInkPointerController::OnTouchEvent(ui::TouchEvent* event) {
|
||||
if (!enabled_)
|
||||
return;
|
||||
|
||||
if (event->pointer_details().pointer_type !=
|
||||
ui::EventPointerType::POINTER_TYPE_PEN)
|
||||
if (event->pointer_details().pointer_type != ui::EventPointerType::kPen)
|
||||
return;
|
||||
|
||||
if (event->type() != ui::ET_TOUCH_MOVED &&
|
||||
|
@ -441,8 +441,7 @@ void MagnificationController::OnMouseEvent(ui::MouseEvent* event) {
|
||||
}
|
||||
|
||||
if (IsMagnified() && event->type() == ui::ET_MOUSE_MOVED &&
|
||||
event->pointer_details().pointer_type !=
|
||||
ui::EventPointerType::POINTER_TYPE_PEN) {
|
||||
event->pointer_details().pointer_type != ui::EventPointerType::kPen) {
|
||||
OnMouseMove(event->root_location());
|
||||
}
|
||||
}
|
||||
|
@ -120,10 +120,8 @@ class MagnificationControllerTest : public AshTestBase {
|
||||
// Performs a two-finger scroll gesture in the given |direction|.
|
||||
void PerformTwoFingersScrollGesture(ScrollDirection direction) {
|
||||
base::TimeTicks time = base::TimeTicks::Now();
|
||||
ui::PointerDetails pointer_details1(
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH, 0);
|
||||
ui::PointerDetails pointer_details2(
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH, 1);
|
||||
ui::PointerDetails pointer_details1(ui::EventPointerType::kTouch, 0);
|
||||
ui::PointerDetails pointer_details2(ui::EventPointerType::kTouch, 1);
|
||||
|
||||
// The offset by which the two fingers will move according to the given
|
||||
// direction.
|
||||
@ -829,10 +827,8 @@ TEST_F(MagnificationControllerTest, PinchZoom) {
|
||||
ASSERT_EQ(2.0f, GetMagnificationController()->GetScale());
|
||||
|
||||
base::TimeTicks time = base::TimeTicks::Now();
|
||||
ui::PointerDetails pointer_details1(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
0);
|
||||
ui::PointerDetails pointer_details2(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
1);
|
||||
ui::PointerDetails pointer_details1(ui::EventPointerType::kTouch, 0);
|
||||
ui::PointerDetails pointer_details2(ui::EventPointerType::kTouch, 1);
|
||||
|
||||
// Simulate pinch gesture.
|
||||
DispatchTouchEvent(ui::ET_TOUCH_PRESSED, gfx::Point(900, 10), time,
|
||||
@ -1009,10 +1005,8 @@ TEST_F(MagnificationControllerTest, ZoomsIntoCenter) {
|
||||
GetMagnificationController()->GetViewportRect().CenterPoint());
|
||||
|
||||
base::TimeTicks time = base::TimeTicks::Now();
|
||||
ui::PointerDetails pointer_details1(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
0);
|
||||
ui::PointerDetails pointer_details2(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
1);
|
||||
ui::PointerDetails pointer_details1(ui::EventPointerType::kTouch, 0);
|
||||
ui::PointerDetails pointer_details2(ui::EventPointerType::kTouch, 1);
|
||||
|
||||
// Simulate pinch gesture with keeping center of bounding box of touches at
|
||||
// (250, 250). Note that GestureProvider dispatches scroll gesture from this
|
||||
|
@ -265,7 +265,7 @@ void PartialMagnificationController::OnLocatedEvent(
|
||||
if (!is_enabled_)
|
||||
return;
|
||||
|
||||
if (pointer_details.pointer_type != ui::EventPointerType::POINTER_TYPE_PEN)
|
||||
if (pointer_details.pointer_type != ui::EventPointerType::kPen)
|
||||
return;
|
||||
|
||||
// Compute the event location in screen space.
|
||||
|
@ -44,7 +44,7 @@ DownEventMetric2 FindCombination(int destination,
|
||||
}
|
||||
|
||||
void RecordUMA(ui::EventPointerType type, ui::EventTarget* event_target) {
|
||||
DCHECK_NE(type, ui::EventPointerType::POINTER_TYPE_UNKNOWN);
|
||||
DCHECK_NE(type, ui::EventPointerType::kUnknown);
|
||||
views::Widget* target = views::Widget::GetTopLevelWidgetForNativeView(
|
||||
static_cast<aura::Window*>(event_target));
|
||||
DownEventFormFactor form_factor = DownEventFormFactor::kClamshell;
|
||||
@ -61,18 +61,18 @@ void RecordUMA(ui::EventPointerType type, ui::EventTarget* event_target) {
|
||||
|
||||
DownEventSource input_type = DownEventSource::kUnknown;
|
||||
switch (type) {
|
||||
case ui::EventPointerType::POINTER_TYPE_UNKNOWN:
|
||||
case ui::EventPointerType::kUnknown:
|
||||
return;
|
||||
case ui::EventPointerType::POINTER_TYPE_MOUSE:
|
||||
case ui::EventPointerType::kMouse:
|
||||
input_type = DownEventSource::kMouse;
|
||||
break;
|
||||
case ui::EventPointerType::POINTER_TYPE_PEN:
|
||||
case ui::EventPointerType::kPen:
|
||||
input_type = DownEventSource::kStylus;
|
||||
break;
|
||||
case ui::EventPointerType::POINTER_TYPE_TOUCH:
|
||||
case ui::EventPointerType::kTouch:
|
||||
input_type = DownEventSource::kTouch;
|
||||
break;
|
||||
case ui::EventPointerType::POINTER_TYPE_ERASER:
|
||||
case ui::EventPointerType::kEraser:
|
||||
input_type = DownEventSource::kStylus;
|
||||
break;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ void PointerMetricsRecorderTest::CreateDownEvent(
|
||||
test_api.SetDisplayRotation(rotation,
|
||||
display::Display::RotationSource::ACTIVE);
|
||||
}
|
||||
if (pointer_type == ui::EventPointerType::POINTER_TYPE_MOUSE) {
|
||||
if (pointer_type == ui::EventPointerType::kMouse) {
|
||||
ui::MouseEvent mouse_down(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
|
||||
base::TimeTicks(), 0, 0);
|
||||
ui::Event::DispatcherApi(&mouse_down).set_target(window);
|
||||
@ -126,282 +126,282 @@ TEST_F(PointerMetricsRecorderTest, DownEventPerCombination) {
|
||||
display::test::ScopedSetInternalDisplayId set_internal(display_manager,
|
||||
display_id);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
DownEventFormFactor::kClamshell, AppType::NON_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kMouse, DownEventFormFactor::kClamshell,
|
||||
AppType::NON_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kNonAppMouseClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModeLandscape, AppType::NON_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kNonAppMouseTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModePortrait, AppType::NON_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kNonAppMouseTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
DownEventFormFactor::kClamshell, AppType::NON_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kPen, DownEventFormFactor::kClamshell,
|
||||
AppType::NON_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kNonAppStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModeLandscape, AppType::NON_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kNonAppStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModePortrait, AppType::NON_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kNonAppStylusTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
DownEventFormFactor::kClamshell, AppType::NON_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kTouch, DownEventFormFactor::kClamshell,
|
||||
AppType::NON_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kNonAppStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModeLandscape, AppType::NON_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kNonAppStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModePortrait, AppType::NON_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kNonAppStylusTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
DownEventFormFactor::kClamshell, AppType::BROWSER);
|
||||
CreateDownEvent(ui::EventPointerType::kMouse, DownEventFormFactor::kClamshell,
|
||||
AppType::BROWSER);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kBrowserMouseClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModeLandscape, AppType::BROWSER);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kBrowserMouseTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModePortrait, AppType::BROWSER);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kBrowserMouseTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
DownEventFormFactor::kClamshell, AppType::BROWSER);
|
||||
CreateDownEvent(ui::EventPointerType::kPen, DownEventFormFactor::kClamshell,
|
||||
AppType::BROWSER);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kBrowserStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModeLandscape, AppType::BROWSER);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kBrowserStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModePortrait, AppType::BROWSER);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kBrowserStylusTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
DownEventFormFactor::kClamshell, AppType::BROWSER);
|
||||
CreateDownEvent(ui::EventPointerType::kTouch, DownEventFormFactor::kClamshell,
|
||||
AppType::BROWSER);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kBrowserStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModeLandscape, AppType::BROWSER);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kBrowserStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModePortrait, AppType::BROWSER);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kBrowserStylusTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
DownEventFormFactor::kClamshell, AppType::CHROME_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kMouse, DownEventFormFactor::kClamshell,
|
||||
AppType::CHROME_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kChromeAppMouseClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModeLandscape,
|
||||
AppType::CHROME_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kChromeAppMouseTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModePortrait,
|
||||
AppType::CHROME_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kChromeAppMouseTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
DownEventFormFactor::kClamshell, AppType::CHROME_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kPen, DownEventFormFactor::kClamshell,
|
||||
AppType::CHROME_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kChromeAppStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModeLandscape,
|
||||
AppType::CHROME_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kChromeAppStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModePortrait,
|
||||
AppType::CHROME_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kChromeAppStylusTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
DownEventFormFactor::kClamshell, AppType::CHROME_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kTouch, DownEventFormFactor::kClamshell,
|
||||
AppType::CHROME_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kChromeAppStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModeLandscape,
|
||||
AppType::CHROME_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kChromeAppStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModePortrait,
|
||||
AppType::CHROME_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kChromeAppStylusTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
DownEventFormFactor::kClamshell, AppType::ARC_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kMouse, DownEventFormFactor::kClamshell,
|
||||
AppType::ARC_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kArcAppMouseClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModeLandscape, AppType::ARC_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kArcAppMouseTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModePortrait, AppType::ARC_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kArcAppMouseTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
DownEventFormFactor::kClamshell, AppType::ARC_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kPen, DownEventFormFactor::kClamshell,
|
||||
AppType::ARC_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kArcAppStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModeLandscape, AppType::ARC_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kArcAppStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModePortrait, AppType::ARC_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kArcAppStylusTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
DownEventFormFactor::kClamshell, AppType::ARC_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kTouch, DownEventFormFactor::kClamshell,
|
||||
AppType::ARC_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kArcAppStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModeLandscape, AppType::ARC_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kArcAppStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModePortrait, AppType::ARC_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kArcAppStylusTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
DownEventFormFactor::kClamshell, AppType::CROSTINI_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kMouse, DownEventFormFactor::kClamshell,
|
||||
AppType::CROSTINI_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kCrostiniAppMouseClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModeLandscape,
|
||||
AppType::CROSTINI_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kCrostiniAppMouseTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_MOUSE,
|
||||
CreateDownEvent(ui::EventPointerType::kMouse,
|
||||
DownEventFormFactor::kTabletModePortrait,
|
||||
AppType::CROSTINI_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kCrostiniAppMouseTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
DownEventFormFactor::kClamshell, AppType::CROSTINI_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kPen, DownEventFormFactor::kClamshell,
|
||||
AppType::CROSTINI_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kCrostiniAppStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModeLandscape,
|
||||
AppType::CROSTINI_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kCrostiniAppStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
CreateDownEvent(ui::EventPointerType::kPen,
|
||||
DownEventFormFactor::kTabletModePortrait,
|
||||
AppType::CROSTINI_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kCrostiniAppStylusTabletPortrait), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
DownEventFormFactor::kClamshell, AppType::CROSTINI_APP);
|
||||
CreateDownEvent(ui::EventPointerType::kTouch, DownEventFormFactor::kClamshell,
|
||||
AppType::CROSTINI_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kCrostiniAppStylusClamshell), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModeLandscape,
|
||||
AppType::CROSTINI_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
kCombinationHistogramName,
|
||||
static_cast<int>(DownEventMetric2::kCrostiniAppStylusTabletLandscape), 1);
|
||||
|
||||
CreateDownEvent(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
CreateDownEvent(ui::EventPointerType::kTouch,
|
||||
DownEventFormFactor::kTabletModePortrait,
|
||||
AppType::CROSTINI_APP);
|
||||
histogram_tester_->ExpectBucketCount(
|
||||
|
@ -164,7 +164,7 @@ TEST_F(ShelfButtonPressedMetricTrackerTest,
|
||||
Launcher_ButtonPressed_MouseIsRecordedWhenIconActivatedByTouch) {
|
||||
const ui::TouchEvent touch_event(
|
||||
ui::ET_GESTURE_TAP, gfx::Point(), base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
base::UserActionTester user_action_tester;
|
||||
ButtonPressed(touch_event);
|
||||
|
@ -257,9 +257,9 @@ TEST_F(ShelfWidgetTest, HiddenShelfHitTestTouch) {
|
||||
// should not find the shelf as the target.
|
||||
{
|
||||
gfx::Point event_location(20, shelf_bounds.y() - 1);
|
||||
ui::TouchEvent touch(
|
||||
ui::ET_TOUCH_PRESSED, event_location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, event_location,
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_NE(shelf_widget->GetNativeWindow(),
|
||||
targeter->FindTargetForEvent(root, &touch));
|
||||
}
|
||||
@ -276,9 +276,9 @@ TEST_F(ShelfWidgetTest, HiddenShelfHitTestTouch) {
|
||||
// shelf as the target.
|
||||
{
|
||||
gfx::Point event_location(20, shelf_bounds.y() - 1);
|
||||
ui::TouchEvent touch(
|
||||
ui::ET_TOUCH_PRESSED, event_location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, event_location,
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_EQ(shelf_widget->GetNativeWindow(),
|
||||
targeter->FindTargetForEvent(root, &touch));
|
||||
}
|
||||
|
@ -159,8 +159,7 @@ class StylusEventHandler : public ui::EventHandler {
|
||||
|
||||
// ui::EventHandler:
|
||||
void OnTouchEvent(ui::TouchEvent* event) override {
|
||||
if (event->pointer_details().pointer_type ==
|
||||
ui::EventPointerType::POINTER_TYPE_PEN) {
|
||||
if (event->pointer_details().pointer_type == ui::EventPointerType::kPen) {
|
||||
palette_tray_->OnStylusEvent(*event);
|
||||
}
|
||||
}
|
||||
|
@ -106,8 +106,7 @@ void MetalayerMode::OnTouchEvent(ui::TouchEvent* event) {
|
||||
if (enabled())
|
||||
return;
|
||||
|
||||
if (event->pointer_details().pointer_type !=
|
||||
ui::EventPointerType::POINTER_TYPE_PEN)
|
||||
if (event->pointer_details().pointer_type != ui::EventPointerType::kPen)
|
||||
return;
|
||||
|
||||
if (event->type() == ui::ET_TOUCH_RELEASED) {
|
||||
|
@ -106,9 +106,9 @@ bool SystemTrayTestApi::Is24HourClock() {
|
||||
void SystemTrayTestApi::TapSelectToSpeakTray() {
|
||||
// The Select-to-Speak tray doesn't actually use the event, so construct
|
||||
// a bare bones event to perform the action.
|
||||
ui::TouchEvent event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(), base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH), 0);
|
||||
ui::TouchEvent event(ui::ET_TOUCH_PRESSED, gfx::Point(),
|
||||
base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch), 0);
|
||||
StatusAreaWidget* status_area_widget =
|
||||
RootWindowController::ForWindow(GetTray()->GetWidget()->GetNativeWindow())
|
||||
->GetStatusAreaWidget();
|
||||
|
@ -285,7 +285,7 @@ class TouchHudProjectionTest : public TouchHudTestBase {
|
||||
int touch_id) {
|
||||
ui::TouchEvent event(
|
||||
type, location, event_time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, touch_id));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, touch_id));
|
||||
GetInternalTouchHudProjection()->OnTouchEvent(&event);
|
||||
|
||||
// Advance time for next event.
|
||||
|
@ -441,7 +441,7 @@ void ScreenshotController::SetSelectedWindow(aura::Window* selected) {
|
||||
bool ScreenshotController::ShouldProcessEvent(
|
||||
const ui::PointerDetails& pointer_details) const {
|
||||
return !pen_events_only_ ||
|
||||
pointer_details.pointer_type == ui::EventPointerType::POINTER_TYPE_PEN;
|
||||
pointer_details.pointer_type == ui::EventPointerType::kPen;
|
||||
}
|
||||
|
||||
void ScreenshotController::OnKeyEvent(ui::KeyEvent* event) {
|
||||
|
@ -175,10 +175,8 @@ void BackGestureEventHandler::OnGestureEvent(ui::GestureEvent* event) {}
|
||||
void BackGestureEventHandler::OnTouchEvent(ui::TouchEvent* event) {
|
||||
// Do not handle PEN and ERASER events for back gesture. PEN events can come
|
||||
// from stylus device.
|
||||
if (event->pointer_details().pointer_type ==
|
||||
ui::EventPointerType::POINTER_TYPE_PEN ||
|
||||
event->pointer_details().pointer_type ==
|
||||
ui::EventPointerType::POINTER_TYPE_ERASER) {
|
||||
if (event->pointer_details().pointer_type == ui::EventPointerType::kPen ||
|
||||
event->pointer_details().pointer_type == ui::EventPointerType::kEraser) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -90,11 +90,11 @@ class BackGestureEventHandlerTest : public AshTestBase {
|
||||
|
||||
// Send touch event with |type| to the toplevel window event handler.
|
||||
void SendTouchEvent(const gfx::Point& position, ui::EventType type) {
|
||||
ui::TouchEvent event = ui::TouchEvent(
|
||||
type, position, base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
/*pointer_id=*/5, /*radius_x=*/5.0f,
|
||||
/*radius_y=*/5.0, /*force=*/1.0f));
|
||||
ui::TouchEvent event =
|
||||
ui::TouchEvent(type, position, base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
/*pointer_id=*/5, /*radius_x=*/5.0f,
|
||||
/*radius_y=*/5.0, /*force=*/1.0f));
|
||||
ui::Event::DispatcherApi(&event).set_target(top_window_.get());
|
||||
Shell::Get()->back_gesture_event_handler()->OnTouchEvent(&event);
|
||||
}
|
||||
|
@ -815,9 +815,9 @@ TEST_F(ImmersiveFullscreenControllerTest, EventsDoNotLeakToWindowUnderneath) {
|
||||
EXPECT_EQ(behind->GetBoundsInScreen().y(), window()->GetBoundsInScreen().y());
|
||||
int top = behind->GetBoundsInScreen().y();
|
||||
|
||||
ui::TouchEvent touch(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(10, top), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch(ui::ET_TOUCH_MOVED, gfx::Point(10, top),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
aura::Window* root = window()->GetRootWindow();
|
||||
ui::EventTargeter* targeter =
|
||||
root->GetHost()->dispatcher()->GetDefaultEventTargeter();
|
||||
@ -828,9 +828,9 @@ TEST_F(ImmersiveFullscreenControllerTest, EventsDoNotLeakToWindowUnderneath) {
|
||||
// Make sure the windows are still aligned on top.
|
||||
EXPECT_EQ(behind->GetBoundsInScreen().y(), window()->GetBoundsInScreen().y());
|
||||
top = behind->GetBoundsInScreen().y();
|
||||
ui::TouchEvent touch2(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(10, top), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch2(ui::ET_TOUCH_MOVED, gfx::Point(10, top),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
// The event should still be targeted to window().
|
||||
EXPECT_EQ(window(), targeter->FindTargetForEvent(root, &touch2));
|
||||
}
|
||||
|
@ -3114,7 +3114,7 @@ class TabletModeOverviewSessionTest : public OverviewSessionTest {
|
||||
ui::ET_GESTURE_LONG_PRESS,
|
||||
gfx::ToRoundedPoint(item->target_bounds().CenterPoint()),
|
||||
base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch));
|
||||
GetEventGenerator()->Dispatch(&long_press);
|
||||
}
|
||||
|
||||
|
@ -177,9 +177,8 @@ TEST_F(WindowManagerTest, Focus) {
|
||||
// Touch on a sub-window (w122) to focus it.
|
||||
gfx::Point click_point = w122->bounds().CenterPoint();
|
||||
aura::Window::ConvertPointToTarget(w122->parent(), root_window, &click_point);
|
||||
ui::TouchEvent touchev(
|
||||
ui::ET_TOUCH_PRESSED, click_point, getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touchev(ui::ET_TOUCH_PRESSED, click_point, getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
details = sink->OnEventFromSource(&touchev);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
focus_client = aura::client::GetFocusClient(w122.get());
|
||||
@ -434,9 +433,8 @@ TEST_F(WindowManagerTest, ActivateOnTouch) {
|
||||
// Touch window2.
|
||||
gfx::Point press_point = w2->bounds().CenterPoint();
|
||||
aura::Window::ConvertPointToTarget(w2->parent(), root_window, &press_point);
|
||||
ui::TouchEvent touchev1(
|
||||
ui::ET_TOUCH_PRESSED, press_point, getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touchev1(ui::ET_TOUCH_PRESSED, press_point, getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
ui::EventSink* sink = root_window->GetHost()->event_sink();
|
||||
ui::EventDispatchDetails details = sink->OnEventFromSource(&touchev1);
|
||||
@ -456,9 +454,8 @@ TEST_F(WindowManagerTest, ActivateOnTouch) {
|
||||
press_point = w1->bounds().CenterPoint();
|
||||
aura::Window::ConvertPointToTarget(w1->parent(), root_window, &press_point);
|
||||
d1.set_activate(false);
|
||||
ui::TouchEvent touchev2(
|
||||
ui::ET_TOUCH_PRESSED, press_point, getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent touchev2(ui::ET_TOUCH_PRESSED, press_point, getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
details = sink->OnEventFromSource(&touchev2);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
|
||||
|
@ -1380,9 +1380,9 @@ TEST_F(WorkspaceControllerTest, WindowEdgeHitTest) {
|
||||
ui::EventTarget* target = targeter->FindTargetForEvent(root, &mouse);
|
||||
EXPECT_EQ(expected_target, target);
|
||||
|
||||
ui::TouchEvent touch(
|
||||
ui::ET_TOUCH_PRESSED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, location,
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
target = targeter->FindTargetForEvent(root, &touch);
|
||||
EXPECT_EQ(expected_target, target);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, MAYBE_NoRewritingEventsWhenOff) {
|
||||
base::TimeTicks initial_time = Now();
|
||||
ui::TouchEvent initial_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(99, 200), initial_time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator.Dispatch(&initial_press);
|
||||
|
||||
// Since the touch exploration controller doesn't know if the user is
|
||||
@ -97,7 +97,7 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, MAYBE_NoRewritingEventsWhenOff) {
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(100, 200),
|
||||
initial_time + gesture_detector_config_.double_tap_timeout +
|
||||
base::TimeDelta::FromMilliseconds(1),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator.Dispatch(&touch_time_advance);
|
||||
|
||||
EXPECT_EQ(0, event_handler_->num_mouse_events());
|
||||
@ -112,13 +112,13 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, MAYBE_NoRewritingEventsWhenOff) {
|
||||
initial_time = Now();
|
||||
ui::TouchEvent second_initial_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(499, 600), initial_time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
generator.Dispatch(&second_initial_press);
|
||||
ui::TouchEvent second_touch_time_advance(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(500, 600),
|
||||
initial_time + gesture_detector_config_.double_tap_timeout +
|
||||
base::TimeDelta::FromMilliseconds(1),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
generator.Dispatch(&second_touch_time_advance);
|
||||
EXPECT_EQ(0, event_handler_->num_mouse_events());
|
||||
EXPECT_EQ(2, event_handler_->num_touch_events());
|
||||
@ -134,7 +134,7 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, DISABLED_RewritesEventsWhenOn) {
|
||||
base::TimeTicks initial_time = Now();
|
||||
ui::TouchEvent initial_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), initial_time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator.Dispatch(&initial_press);
|
||||
|
||||
// Since the touch exploration controller doesn't know if the user is
|
||||
@ -146,7 +146,7 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, DISABLED_RewritesEventsWhenOn) {
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(100, 200),
|
||||
initial_time + gesture_detector_config_.double_tap_timeout +
|
||||
base::TimeDelta::FromMilliseconds(1),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator.Dispatch(&touch_time_advance);
|
||||
|
||||
// Number of mouse events may be greater than 1 because of ET_MOUSE_ENTERED.
|
||||
@ -157,13 +157,13 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, DISABLED_RewritesEventsWhenOn) {
|
||||
initial_time = Now();
|
||||
ui::TouchEvent second_initial_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(500, 600), initial_time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
generator.Dispatch(&second_initial_press);
|
||||
ui::TouchEvent second_touch_time_advance(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(500, 600),
|
||||
initial_time + gesture_detector_config_.double_tap_timeout +
|
||||
base::TimeDelta::FromMilliseconds(1),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
generator.Dispatch(&second_touch_time_advance);
|
||||
EXPECT_GT(event_handler_->num_mouse_events(), 0);
|
||||
EXPECT_EQ(1, event_handler_->num_touch_events());
|
||||
@ -177,7 +177,7 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, DISABLED_RewritesEventsWhenOn) {
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(500, 600),
|
||||
initial_time + gesture_detector_config_.double_tap_timeout +
|
||||
base::TimeDelta::FromMilliseconds(1),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
generator.Dispatch(&release_second_touch);
|
||||
EXPECT_GT(event_handler_->num_mouse_events(), 0);
|
||||
EXPECT_EQ(1, event_handler_->num_touch_events());
|
||||
@ -203,7 +203,7 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, DISABLED_SplitTapExplore) {
|
||||
base::TimeTicks initial_time = Now();
|
||||
ui::TouchEvent initial_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), initial_time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator.Dispatch(&initial_press);
|
||||
EXPECT_TRUE(cursor_client->IsMouseEventsEnabled());
|
||||
EXPECT_TRUE(cursor_client->IsCursorVisible());
|
||||
@ -214,7 +214,7 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, DISABLED_SplitTapExplore) {
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(100, 200),
|
||||
initial_time + gesture_detector_config_.double_tap_timeout +
|
||||
base::TimeDelta::FromMilliseconds(1),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator.Dispatch(&touch_time_advance);
|
||||
EXPECT_TRUE(cursor_client->IsMouseEventsEnabled());
|
||||
EXPECT_FALSE(cursor_client->IsCursorVisible());
|
||||
|
@ -2835,7 +2835,7 @@ TEST_F(EventRewriterTest, TestRewriteNonNativeEvent) {
|
||||
gfx::Point location(0, 0);
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, location, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, kTouchId));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, kTouchId));
|
||||
press.set_flags(ui::EF_CONTROL_DOWN);
|
||||
|
||||
TestEventRewriterContinuation continuation;
|
||||
|
@ -208,7 +208,7 @@ void AdaptiveScreenBrightnessManager::OnUserActivity(
|
||||
key_counter_->Log(time_since_boot);
|
||||
} else if (event->IsTouchEvent()) {
|
||||
if (event->AsTouchEvent()->pointer_details().pointer_type ==
|
||||
ui::EventPointerType::POINTER_TYPE_PEN) {
|
||||
ui::EventPointerType::kPen) {
|
||||
stylus_counter_->Log(time_since_boot);
|
||||
} else {
|
||||
touch_counter_->Log(time_since_boot);
|
||||
|
@ -584,7 +584,7 @@ TEST_F(AdaptiveScreenBrightnessManagerTest, UserEventCounts) {
|
||||
|
||||
const ui::TouchEvent kTouchEvent(
|
||||
ui::ET_TOUCH_PRESSED, kEventLocation, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ReportUserActivity(&kTouchEvent);
|
||||
ReportUserActivity(&kTouchEvent);
|
||||
|
||||
@ -597,8 +597,7 @@ TEST_F(AdaptiveScreenBrightnessManagerTest, UserEventCounts) {
|
||||
|
||||
const ui::TouchEvent kStylusEvent(
|
||||
ui::ET_TOUCH_MOVED, kEventLocation, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_PEN, 0),
|
||||
ui::EF_NONE);
|
||||
ui::PointerDetails(ui::EventPointerType::kPen, 0), ui::EF_NONE);
|
||||
ReportUserActivity(&kStylusEvent);
|
||||
ReportUserActivity(&kStylusEvent);
|
||||
ReportUserActivity(&kStylusEvent);
|
||||
|
@ -536,7 +536,7 @@ TEST_F(IdleEventNotifierTest, UserInputEventsOneIdleEvent) {
|
||||
gfx::Point(0, 0), base::TimeTicks(), 0, 0);
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), base::TimeTicks::UnixEpoch(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
const base::Time first_activity_time = base::Time::Now();
|
||||
// This key event will be too old to be counted.
|
||||
@ -599,7 +599,7 @@ TEST_F(IdleEventNotifierTest, UserInputEventsTwoIdleEvents) {
|
||||
gfx::Point(0, 0), base::TimeTicks(), 0, 0);
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), base::TimeTicks::UnixEpoch(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
const base::Time now_1 = base::Time::Now();
|
||||
idle_event_notifier_->OnUserActivity(&key_event);
|
||||
|
@ -243,7 +243,7 @@ void SmartChargingManager::OnUserActivity(const ui::Event* event) {
|
||||
}
|
||||
if (event->IsTouchEvent()) {
|
||||
if (event->AsTouchEvent()->pointer_details().pointer_type ==
|
||||
ui::EventPointerType::POINTER_TYPE_PEN) {
|
||||
ui::EventPointerType::kPen) {
|
||||
stylus_counter_->Log(time_since_boot);
|
||||
return;
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ TEST_F(SmartChargingManagerTest, UserEventCounts) {
|
||||
|
||||
const ui::TouchEvent kTouchEvent(
|
||||
ui::ET_TOUCH_PRESSED, kEventLocation, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ReportUserActivity(&kTouchEvent);
|
||||
ReportUserActivity(&kTouchEvent);
|
||||
|
||||
@ -258,8 +258,7 @@ TEST_F(SmartChargingManagerTest, UserEventCounts) {
|
||||
|
||||
const ui::TouchEvent kStylusEvent(
|
||||
ui::ET_TOUCH_MOVED, kEventLocation, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_PEN, 0),
|
||||
ui::EF_NONE);
|
||||
ui::PointerDetails(ui::EventPointerType::kPen, 0), ui::EF_NONE);
|
||||
ReportUserActivity(&kStylusEvent);
|
||||
ReportUserActivity(&kStylusEvent);
|
||||
ReportUserActivity(&kStylusEvent);
|
||||
|
@ -326,12 +326,12 @@ IN_PROC_BROWSER_TEST_F(FullscreenControlViewTest, TouchPopupInteraction) {
|
||||
// Simulate a short tap that doesn't trigger the popup.
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
|
||||
ASSERT_FALSE(host->IsVisible());
|
||||
@ -339,7 +339,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControlViewTest, TouchPopupInteraction) {
|
||||
// Simulate a press-and-hold.
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
|
||||
ui::GestureEvent gesture(1, 1, 0, ui::EventTimeForNow(),
|
||||
@ -350,14 +350,14 @@ IN_PROC_BROWSER_TEST_F(FullscreenControlViewTest, TouchPopupInteraction) {
|
||||
RunLoopUntilVisibilityChanges();
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
ASSERT_TRUE(host->IsVisible());
|
||||
|
||||
// Simulate pressing outside the popup, which should hide the popup.
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
RunLoopUntilVisibilityChanges();
|
||||
ASSERT_FALSE(host->IsVisible());
|
||||
@ -365,7 +365,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControlViewTest, TouchPopupInteraction) {
|
||||
// Simulate a press-and-hold again.
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
|
||||
gesture =
|
||||
@ -377,7 +377,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControlViewTest, TouchPopupInteraction) {
|
||||
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
ASSERT_TRUE(host->IsVisible());
|
||||
|
||||
@ -385,7 +385,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControlViewTest, TouchPopupInteraction) {
|
||||
// browser to exit fullscreen and destroy the exit control and its host.
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
GetFullscreenControlView()->ButtonPressed(GetFullscreenExitButton(),
|
||||
touch_event);
|
||||
|
||||
@ -413,7 +413,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControlViewTest,
|
||||
// Simulate a press-and-hold.
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
ui::GestureEvent gesture(1, 1, 0, ui::EventTimeForNow(),
|
||||
ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS));
|
||||
@ -429,14 +429,14 @@ IN_PROC_BROWSER_TEST_F(FullscreenControlViewTest,
|
||||
// Release the touch, which should have no effect.
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
ASSERT_FALSE(host->IsVisible());
|
||||
|
||||
// Simulate a press-and-hold to trigger the UI.
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
gesture =
|
||||
ui::GestureEvent(1, 1, 0, ui::EventTimeForNow(),
|
||||
@ -462,7 +462,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControlViewTest,
|
||||
// Press outside the popup, which should hide the popup.
|
||||
touch_event = ui::TouchEvent(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(1, 1), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host->OnTouchEvent(touch_event);
|
||||
RunLoopUntilVisibilityChanges();
|
||||
ASSERT_FALSE(host->IsVisible());
|
||||
|
@ -317,7 +317,7 @@ class TouchExplorationTest : public aura::test::AuraTestBase {
|
||||
void EnterTouchExplorationModeAtLocation(gfx::Point tap_location) {
|
||||
ui::TouchEvent touch_press(
|
||||
ui::ET_TOUCH_PRESSED, tap_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&touch_press);
|
||||
AdvanceSimulatedTimePastTapDelay();
|
||||
EXPECT_TRUE(IsInTouchToMouseMode());
|
||||
@ -542,7 +542,7 @@ TEST_F(TouchExplorationTest, TurnOnMidTouch) {
|
||||
SwitchTouchExplorationMode(true);
|
||||
ui::TouchEvent touch_move(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(111, 112), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&touch_move);
|
||||
EXPECT_TRUE(cursor_client()->IsCursorVisible());
|
||||
EXPECT_FALSE(cursor_client()->IsMouseEventsEnabled());
|
||||
@ -569,7 +569,7 @@ TEST_F(TouchExplorationTest, TurnOnMidTouch) {
|
||||
// The release of the first finger shouldn't be affected.
|
||||
ui::TouchEvent touch_release(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(111, 112), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&touch_release);
|
||||
captured_events = GetCapturedLocatedEvents();
|
||||
ASSERT_EQ(1u, captured_events.size());
|
||||
@ -998,7 +998,7 @@ TEST_F(TouchExplorationTest, SplitTap) {
|
||||
// After the release, there is still a finger in touch explore mode.
|
||||
ui::TouchEvent split_tap_press(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press);
|
||||
// To simulate the behavior of the real device, we manually disable
|
||||
// mouse events. To not rely on manually setting the state, this is also
|
||||
@ -1009,7 +1009,7 @@ TEST_F(TouchExplorationTest, SplitTap) {
|
||||
EXPECT_FALSE(IsInGestureInProgressState());
|
||||
ui::TouchEvent split_tap_release(
|
||||
ui::ET_TOUCH_RELEASED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_release);
|
||||
// Releasing the second finger should re-enable mouse events putting us
|
||||
// back into the touch exploration mode.
|
||||
@ -1028,7 +1028,7 @@ TEST_F(TouchExplorationTest, SplitTap) {
|
||||
|
||||
ui::TouchEvent touch_explore_release(
|
||||
ui::ET_TOUCH_RELEASED, initial_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&touch_explore_release);
|
||||
AdvanceSimulatedTimePastTapDelay();
|
||||
EXPECT_TRUE(IsInNoFingersDownState());
|
||||
@ -1059,15 +1059,15 @@ TEST_F(TouchExplorationTest, SplitTapRelease) {
|
||||
// not at the location of the second tap and release.
|
||||
ui::TouchEvent split_tap_press(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press);
|
||||
ui::TouchEvent touch_explore_release(
|
||||
ui::ET_TOUCH_RELEASED, initial_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&touch_explore_release);
|
||||
ui::TouchEvent split_tap_release(
|
||||
ui::ET_TOUCH_RELEASED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_release);
|
||||
EXPECT_TRUE(IsInNoFingersDownState());
|
||||
|
||||
@ -1102,7 +1102,7 @@ TEST_F(TouchExplorationTest, SplitTapMultiFinger) {
|
||||
// Now tap at a different location
|
||||
ui::TouchEvent split_tap_press(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press);
|
||||
simulated_clock_.Advance(gesture_detector_config_.longpress_timeout);
|
||||
|
||||
@ -1110,22 +1110,22 @@ TEST_F(TouchExplorationTest, SplitTapMultiFinger) {
|
||||
// enter the wait state.
|
||||
ui::TouchEvent third_press(
|
||||
ui::ET_TOUCH_PRESSED, third_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
generator_->Dispatch(&third_press);
|
||||
|
||||
// When all three fingers are released, no events should be captured.
|
||||
// All fingers should then be up.
|
||||
ui::TouchEvent touch_explore_release(
|
||||
ui::ET_TOUCH_RELEASED, initial_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&touch_explore_release);
|
||||
ui::TouchEvent split_tap_release(
|
||||
ui::ET_TOUCH_RELEASED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_release);
|
||||
ui::TouchEvent third_tap_release(
|
||||
ui::ET_TOUCH_RELEASED, third_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
generator_->Dispatch(&third_tap_release);
|
||||
|
||||
std::vector<ui::LocatedEvent*> captured_events = GetCapturedLocatedEvents();
|
||||
@ -1151,22 +1151,22 @@ TEST_F(TouchExplorationTest, SplitTapLeaveSlop) {
|
||||
// Now tap at a different location for split tap.
|
||||
ui::TouchEvent split_tap_press(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press);
|
||||
|
||||
// Move the first finger out of slop and release both fingers. The split
|
||||
// tap should have been cancelled.
|
||||
ui::TouchEvent first_touch_move(
|
||||
ui::ET_TOUCH_MOVED, first_move_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_touch_move);
|
||||
ui::TouchEvent first_touch_release(
|
||||
ui::ET_TOUCH_RELEASED, first_move_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_touch_release);
|
||||
ui::TouchEvent second_touch_release(
|
||||
ui::ET_TOUCH_RELEASED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&second_touch_release);
|
||||
|
||||
std::vector<ui::LocatedEvent*> captured_events = GetCapturedLocatedEvents();
|
||||
@ -1178,22 +1178,22 @@ TEST_F(TouchExplorationTest, SplitTapLeaveSlop) {
|
||||
ClearCapturedEvents();
|
||||
ui::TouchEvent split_tap_press2(
|
||||
ui::ET_TOUCH_PRESSED, second_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&split_tap_press2);
|
||||
|
||||
// Move the second finger out of slop and release both fingers. The split
|
||||
// tap should have been cancelled.
|
||||
ui::TouchEvent second_touch_move2(
|
||||
ui::ET_TOUCH_MOVED, second_move_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&second_touch_move2);
|
||||
ui::TouchEvent first_touch_release2(
|
||||
ui::ET_TOUCH_RELEASED, first_touch_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_touch_release2);
|
||||
ui::TouchEvent second_touch_release2(
|
||||
ui::ET_TOUCH_RELEASED, second_move_location, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&second_touch_release2);
|
||||
|
||||
captured_events = GetCapturedLocatedEvents();
|
||||
@ -1213,7 +1213,7 @@ TEST_F(TouchExplorationTest, EnterGestureInProgressState) {
|
||||
float distance = gesture_detector_config_.touch_slop + 1;
|
||||
ui::TouchEvent first_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 101), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
gfx::Point second_location(100 + distance / 2, 101);
|
||||
gfx::Point third_location(100 + distance, 101);
|
||||
gfx::Point touch_exploration_location(120, 121);
|
||||
@ -1390,18 +1390,15 @@ TEST_F(TouchExplorationTest, DISABLED_AllFingerPermutations) {
|
||||
int y = 10 * touch_id + 102;
|
||||
all_events.push_back(std::make_unique<ui::TouchEvent>(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(x++, y++), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
touch_id)));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, touch_id)));
|
||||
queued_events.push_back(all_events.back().get());
|
||||
all_events.push_back(std::make_unique<ui::TouchEvent>(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(x++, y++), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
touch_id)));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, touch_id)));
|
||||
queued_events.push_back(all_events.back().get());
|
||||
all_events.push_back(std::make_unique<ui::TouchEvent>(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(x, y), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
touch_id)));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, touch_id)));
|
||||
queued_events.push_back(all_events.back().get());
|
||||
}
|
||||
|
||||
@ -1506,7 +1503,7 @@ TEST_F(TouchExplorationTest, GestureAddedFinger) {
|
||||
float distance = gesture_detector_config_.touch_slop + 1;
|
||||
ui::TouchEvent first_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_press);
|
||||
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
|
||||
gfx::Point second_location(100 + distance, 200);
|
||||
@ -1520,7 +1517,7 @@ TEST_F(TouchExplorationTest, GestureAddedFinger) {
|
||||
// gestures are prevented from continuing to go through.
|
||||
ui::TouchEvent second_press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(220, 221), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator_->Dispatch(&second_press);
|
||||
AdvanceSimulatedTimePastTapDelay();
|
||||
EXPECT_FALSE(IsInGestureInProgressState());
|
||||
@ -1537,7 +1534,7 @@ TEST_F(TouchExplorationTest, InBoundariesTouchExploration) {
|
||||
gfx::Point initial_press(window.right() - (GetMaxDistanceFromEdge() + GetLeavingDistanceFromEdge()) / 2, GetLeavingDistanceFromEdge() + 1);
|
||||
ui::TouchEvent first_press(
|
||||
ui::ET_TOUCH_PRESSED, initial_press, Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
generator_->Dispatch(&first_press);
|
||||
EXPECT_FALSE(IsInGestureInProgressState());
|
||||
EXPECT_FALSE(IsInTouchToMouseMode());
|
||||
@ -1600,24 +1597,24 @@ TEST_F(TouchExplorationTest, TwoFingerTapAndMoveFirstFinger) {
|
||||
// tap.
|
||||
ui::TouchEvent first_press_id_1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent first_press_id_2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(110, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
|
||||
ui::TouchEvent slop_move_id_1(
|
||||
ui::ET_TOUCH_MOVED,
|
||||
gfx::Point(100 + gesture_detector_config_.touch_slop, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent slop_move_id_2(
|
||||
ui::ET_TOUCH_MOVED,
|
||||
gfx::Point(110 + gesture_detector_config_.touch_slop, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
|
||||
ui::TouchEvent out_slop_id_1(
|
||||
ui::ET_TOUCH_MOVED,
|
||||
gfx::Point(100 + gesture_detector_config_.touch_slop + 1, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
// Dispatch the inital presses.
|
||||
generator_->Dispatch(&first_press_id_1);
|
||||
@ -1650,15 +1647,15 @@ TEST_F(TouchExplorationTest, TwoFingerTapAndMoveSecondFinger) {
|
||||
// tap.
|
||||
ui::TouchEvent first_press_id_1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent first_press_id_2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(110, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
|
||||
ui::TouchEvent out_slop_id_2(
|
||||
ui::ET_TOUCH_MOVED,
|
||||
gfx::Point(100 + gesture_detector_config_.touch_slop + 1, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
generator_->Dispatch(&first_press_id_1);
|
||||
EXPECT_FALSE(IsInTwoFingerTapState());
|
||||
@ -1776,28 +1773,28 @@ TEST_F(TouchExplorationTest, ThreeOrFourFingerTap) {
|
||||
|
||||
ui::TouchEvent press_id_1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent release_id_1(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(100, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent press_id_2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(110, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
ui::TouchEvent release_id_2(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(110, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
ui::TouchEvent press_id_3(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(120, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 3));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 3));
|
||||
ui::TouchEvent release_id_3(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(120, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 3));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 3));
|
||||
ui::TouchEvent press_id_4(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(130, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 4));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 4));
|
||||
ui::TouchEvent release_id_4(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(120, 200), Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 4));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 4));
|
||||
|
||||
// Three fingers down.
|
||||
generator_->Dispatch(&press_id_1);
|
||||
|
@ -445,8 +445,7 @@ void WebviewClient::SendTouchInput(const Webview* webview,
|
||||
touch_input->set_y(y);
|
||||
touch_input->set_root_x(x);
|
||||
touch_input->set_root_y(y);
|
||||
touch_input->set_pointer_type(
|
||||
static_cast<int>(ui::EventPointerType::POINTER_TYPE_TOUCH));
|
||||
touch_input->set_pointer_type(static_cast<int>(ui::EventPointerType::kTouch));
|
||||
touch_input->set_pointer_id(id);
|
||||
|
||||
auto input_event = std::make_unique<InputEvent>();
|
||||
|
@ -71,16 +71,16 @@ class MultipleTapDetectorTest : public aura::test::AuraTestBase {
|
||||
|
||||
// Simulate a tap event.
|
||||
void Tap(const gfx::Point& tap_point) {
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, tap_point, simulated_clock_.NowTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
ui::kPointerIdUnknown));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, tap_point,
|
||||
simulated_clock_.NowTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
ui::kPointerIdUnknown));
|
||||
generator_->Dispatch(&press);
|
||||
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(kTapLengthMs));
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, tap_point, simulated_clock_.NowTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
ui::kPointerIdUnknown));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, tap_point,
|
||||
simulated_clock_.NowTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
ui::kPointerIdUnknown));
|
||||
generator_->Dispatch(&release);
|
||||
}
|
||||
|
||||
|
@ -99,16 +99,14 @@ class SideSwipeDetectorTest : public aura::test::AuraTestBase {
|
||||
bool end_release = true) {
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, start_point, mock_clock()->NowTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
pointer_id));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, pointer_id));
|
||||
GetEventGenerator().Dispatch(&press);
|
||||
mock_task_runner()->AdvanceMockTickClock(start_hold_time);
|
||||
mock_task_runner()->FastForwardBy(start_hold_time);
|
||||
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, end_point, mock_clock()->NowTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
pointer_id));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, pointer_id));
|
||||
GetEventGenerator().Dispatch(&move);
|
||||
mock_task_runner()->AdvanceMockTickClock(drag_time);
|
||||
mock_task_runner()->FastForwardBy(drag_time);
|
||||
@ -116,8 +114,7 @@ class SideSwipeDetectorTest : public aura::test::AuraTestBase {
|
||||
if (end_release) {
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, end_point, mock_clock()->NowTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
pointer_id));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, pointer_id));
|
||||
GetEventGenerator().Dispatch(&release);
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ void Touch::OnTouchEvent(ui::TouchEvent* event) {
|
||||
delegate_->OnTouchDown(target, event->time_stamp(), touch_pointer_id,
|
||||
location);
|
||||
if (stylus_delegate_ && event->pointer_details().pointer_type !=
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH) {
|
||||
ui::EventPointerType::kTouch) {
|
||||
stylus_delegate_->OnTouchTool(touch_pointer_id,
|
||||
event->pointer_details().pointer_type);
|
||||
}
|
||||
@ -162,8 +162,8 @@ void Touch::OnTouchEvent(ui::TouchEvent* event) {
|
||||
minor = major;
|
||||
delegate_->OnTouchShape(touch_pointer_id, major, minor);
|
||||
|
||||
if (stylus_delegate_ && event->pointer_details().pointer_type !=
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH) {
|
||||
if (stylus_delegate_ &&
|
||||
event->pointer_details().pointer_type != ui::EventPointerType::kTouch) {
|
||||
if (!std::isnan(event->pointer_details().force)) {
|
||||
stylus_delegate_->OnTouchForce(event->time_stamp(), touch_pointer_id,
|
||||
event->pointer_details().force);
|
||||
|
@ -238,7 +238,7 @@ TEST_F(TouchTest, OnTouchCancel) {
|
||||
EXPECT_CALL(delegate, OnTouchFrame());
|
||||
ui::TouchEvent cancel_event(
|
||||
ui::ET_TOUCH_CANCELLED, gfx::Point(), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
generator.Dispatch(&cancel_event);
|
||||
|
||||
EXPECT_CALL(delegate, OnTouchDestroying(touch.get()));
|
||||
@ -411,14 +411,13 @@ TEST_F(TouchTest, OnTouchTool) {
|
||||
testing::InSequence sequence;
|
||||
EXPECT_CALL(delegate, OnTouchDown(window.surface(), testing::_, testing::_,
|
||||
gfx::PointF()));
|
||||
EXPECT_CALL(stylus_delegate,
|
||||
OnTouchTool(0, ui::EventPointerType::POINTER_TYPE_PEN));
|
||||
EXPECT_CALL(stylus_delegate, OnTouchTool(0, ui::EventPointerType::kPen));
|
||||
EXPECT_CALL(delegate, OnTouchFrame());
|
||||
EXPECT_CALL(delegate, OnTouchUp(testing::_, testing::_));
|
||||
EXPECT_CALL(delegate, OnTouchFrame());
|
||||
}
|
||||
generator.set_current_screen_location(window.origin());
|
||||
generator.SetTouchPointerType(ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
generator.SetTouchPointerType(ui::EventPointerType::kPen);
|
||||
generator.PressTouch();
|
||||
generator.ReleaseTouch();
|
||||
|
||||
@ -446,15 +445,14 @@ TEST_F(TouchTest, OnTouchForce) {
|
||||
testing::InSequence sequence;
|
||||
EXPECT_CALL(delegate, OnTouchDown(window.surface(), testing::_, testing::_,
|
||||
gfx::PointF()));
|
||||
EXPECT_CALL(stylus_delegate,
|
||||
OnTouchTool(0, ui::EventPointerType::POINTER_TYPE_PEN));
|
||||
EXPECT_CALL(stylus_delegate, OnTouchTool(0, ui::EventPointerType::kPen));
|
||||
EXPECT_CALL(stylus_delegate, OnTouchForce(testing::_, 0, 1.0));
|
||||
EXPECT_CALL(delegate, OnTouchFrame());
|
||||
EXPECT_CALL(delegate, OnTouchUp(testing::_, testing::_));
|
||||
EXPECT_CALL(delegate, OnTouchFrame());
|
||||
}
|
||||
generator.set_current_screen_location(window.origin());
|
||||
generator.SetTouchPointerType(ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
generator.SetTouchPointerType(ui::EventPointerType::kPen);
|
||||
generator.SetTouchForce(1.0);
|
||||
generator.PressTouch();
|
||||
generator.ReleaseTouch();
|
||||
@ -483,8 +481,7 @@ TEST_F(TouchTest, OnTouchTilt) {
|
||||
testing::InSequence sequence;
|
||||
EXPECT_CALL(delegate, OnTouchDown(window.surface(), testing::_, testing::_,
|
||||
gfx::PointF()));
|
||||
EXPECT_CALL(stylus_delegate,
|
||||
OnTouchTool(0, ui::EventPointerType::POINTER_TYPE_PEN));
|
||||
EXPECT_CALL(stylus_delegate, OnTouchTool(0, ui::EventPointerType::kPen));
|
||||
EXPECT_CALL(stylus_delegate,
|
||||
OnTouchTilt(testing::_, 0, gfx::Vector2dF(1.0, 2.0)));
|
||||
EXPECT_CALL(delegate, OnTouchFrame());
|
||||
@ -492,7 +489,7 @@ TEST_F(TouchTest, OnTouchTilt) {
|
||||
EXPECT_CALL(delegate, OnTouchFrame());
|
||||
}
|
||||
generator.set_current_screen_location(window.origin());
|
||||
generator.SetTouchPointerType(ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
generator.SetTouchPointerType(ui::EventPointerType::kPen);
|
||||
generator.SetTouchTilt(1.0, 2.0);
|
||||
generator.PressTouch();
|
||||
generator.ReleaseTouch();
|
||||
|
@ -30,9 +30,9 @@ class WaylandTouchStylusDelegate : public TouchStylusDelegate {
|
||||
void OnTouchDestroying(Touch* touch) override { touch_ = nullptr; }
|
||||
void OnTouchTool(int touch_id, ui::EventPointerType type) override {
|
||||
uint wayland_type = ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_TOUCH;
|
||||
if (type == ui::EventPointerType::POINTER_TYPE_PEN)
|
||||
if (type == ui::EventPointerType::kPen)
|
||||
wayland_type = ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_PEN;
|
||||
else if (type == ui::EventPointerType::POINTER_TYPE_ERASER)
|
||||
else if (type == ui::EventPointerType::kEraser)
|
||||
wayland_type = ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ERASER;
|
||||
zcr_touch_stylus_v2_send_tool(resource_, touch_id, wayland_type);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ class TouchSelectionControllerClientAura::EnvEventObserver
|
||||
// from touch as this can clear an active selection generated by the pen.
|
||||
if ((event.flags() & (ui::EF_IS_SYNTHESIZED | ui::EF_FROM_TOUCH)) ||
|
||||
event.AsMouseEvent()->pointer_details().pointer_type ==
|
||||
ui::EventPointerType::POINTER_TYPE_PEN) {
|
||||
ui::EventPointerType::kPen) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -360,9 +360,8 @@ class TouchSelectionControllerClientAuraSiteIsolationTest
|
||||
aura::Window* content_window = view->GetNativeView();
|
||||
aura::Window::ConvertPointToTarget(content_window, shell_window, &point);
|
||||
ui::EventSink* sink = content_window->GetHost()->event_sink();
|
||||
ui::TouchEvent touch(
|
||||
type, point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch(type, point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::EventDispatchDetails details = sink->OnEventFromSource(&touch);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
}
|
||||
@ -614,7 +613,7 @@ IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest,
|
||||
// 1) Send touch-down.
|
||||
ui::TouchEvent touch_down(
|
||||
ui::ET_TOUCH_PRESSED, scroll_start_position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
parent_view->OnTouchEvent(&touch_down);
|
||||
EXPECT_EQ(ui::TouchSelectionController::SELECTION_ACTIVE,
|
||||
selection_controller->active_status());
|
||||
@ -626,7 +625,7 @@ IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest,
|
||||
// 2) Send touch-move.
|
||||
ui::TouchEvent touch_move(
|
||||
ui::ET_TOUCH_MOVED, scroll_end_position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
parent_view->OnTouchEvent(&touch_move);
|
||||
EXPECT_EQ(ui::TouchSelectionController::SELECTION_ACTIVE,
|
||||
selection_controller->active_status());
|
||||
@ -683,9 +682,9 @@ IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest,
|
||||
EXPECT_FALSE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning());
|
||||
|
||||
// 3) Send touch-end.
|
||||
ui::TouchEvent touch_up(
|
||||
ui::ET_TOUCH_RELEASED, scroll_end_position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch_up(ui::ET_TOUCH_RELEASED, scroll_end_position,
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
parent_view->OnTouchEvent(&touch_up);
|
||||
EXPECT_EQ(ui::TouchSelectionController::SELECTION_ACTIVE,
|
||||
selection_controller->active_status());
|
||||
@ -856,7 +855,7 @@ IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest, HiddenOnScroll) {
|
||||
// there.
|
||||
ui::TouchEvent touch_down(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_down);
|
||||
EXPECT_EQ(ui::TouchSelectionController::SELECTION_ACTIVE,
|
||||
rwhva->selection_controller()->active_status());
|
||||
@ -888,9 +887,9 @@ IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest, HiddenOnScroll) {
|
||||
EXPECT_FALSE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning());
|
||||
|
||||
// Lift the finger up: the quick menu should re-appear.
|
||||
ui::TouchEvent touch_up(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch_up(ui::ET_TOUCH_RELEASED, gfx::Point(10, 10),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_up);
|
||||
EXPECT_EQ(ui::TouchSelectionController::SELECTION_ACTIVE,
|
||||
rwhva->selection_controller()->active_status());
|
||||
@ -980,7 +979,7 @@ IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
|
||||
ui::SELECTION_HANDLE_DRAG_STARTED);
|
||||
ui::TouchEvent touch_down(
|
||||
ui::ET_TOUCH_PRESSED, handle_point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_down);
|
||||
selection_controller_client()->Wait();
|
||||
|
||||
@ -990,16 +989,16 @@ IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
|
||||
handle_point.Offset(10, 0);
|
||||
ui::TouchEvent touch_move(
|
||||
ui::ET_TOUCH_MOVED, handle_point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_move);
|
||||
selection_controller_client()->Wait();
|
||||
|
||||
// Then release.
|
||||
selection_controller_client()->InitWaitForSelectionEvent(
|
||||
ui::SELECTION_HANDLE_DRAG_STOPPED);
|
||||
ui::TouchEvent touch_up(
|
||||
ui::ET_TOUCH_RELEASED, handle_point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch_up(ui::ET_TOUCH_RELEASED, handle_point,
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_up);
|
||||
selection_controller_client()->Wait();
|
||||
|
||||
@ -1058,7 +1057,7 @@ IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
|
||||
ui::INSERTION_HANDLE_DRAG_STARTED);
|
||||
ui::TouchEvent touch_down(
|
||||
ui::ET_TOUCH_PRESSED, handle_point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_down);
|
||||
selection_controller_client()->Wait();
|
||||
|
||||
@ -1068,16 +1067,16 @@ IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
|
||||
handle_point.Offset(10, 0);
|
||||
ui::TouchEvent touch_move(
|
||||
ui::ET_TOUCH_MOVED, handle_point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_move);
|
||||
selection_controller_client()->Wait();
|
||||
|
||||
// Then release.
|
||||
selection_controller_client()->InitWaitForSelectionEvent(
|
||||
ui::INSERTION_HANDLE_DRAG_STOPPED);
|
||||
ui::TouchEvent touch_up(
|
||||
ui::ET_TOUCH_RELEASED, handle_point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch_up(ui::ET_TOUCH_RELEASED, handle_point,
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_up);
|
||||
selection_controller_client()->Wait();
|
||||
|
||||
|
@ -1354,11 +1354,11 @@ ui::TextInputClient::FocusReason RenderWidgetHostViewAura::GetFocusReason()
|
||||
return ui::TextInputClient::FOCUS_REASON_NONE;
|
||||
|
||||
switch (last_pointer_type_before_focus_) {
|
||||
case ui::EventPointerType::POINTER_TYPE_MOUSE:
|
||||
case ui::EventPointerType::kMouse:
|
||||
return ui::TextInputClient::FOCUS_REASON_MOUSE;
|
||||
case ui::EventPointerType::POINTER_TYPE_PEN:
|
||||
case ui::EventPointerType::kPen:
|
||||
return ui::TextInputClient::FOCUS_REASON_PEN;
|
||||
case ui::EventPointerType::POINTER_TYPE_TOUCH:
|
||||
case ui::EventPointerType::kTouch:
|
||||
return ui::TextInputClient::FOCUS_REASON_TOUCH;
|
||||
default:
|
||||
return ui::TextInputClient::FOCUS_REASON_OTHER;
|
||||
@ -1718,7 +1718,7 @@ bool RenderWidgetHostViewAura::RequiresDoubleTapGestureEvents() const {
|
||||
// RenderWidgetHostViewAura, ui::EventHandler implementation:
|
||||
|
||||
void RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) {
|
||||
last_pointer_type_ = ui::EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
last_pointer_type_ = ui::EventPointerType::kUnknown;
|
||||
event_handler_->OnKeyEvent(event);
|
||||
}
|
||||
|
||||
@ -1733,7 +1733,7 @@ void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
|
||||
last_mouse_move_location_ = event->location();
|
||||
}
|
||||
#endif
|
||||
last_pointer_type_ = ui::EventPointerType::POINTER_TYPE_MOUSE;
|
||||
last_pointer_type_ = ui::EventPointerType::kMouse;
|
||||
event_handler_->OnMouseEvent(event);
|
||||
}
|
||||
|
||||
@ -1785,7 +1785,7 @@ void RenderWidgetHostViewAura::FocusedNodeChanged(
|
||||
|
||||
#if defined(OS_WIN)
|
||||
bool dismiss_virtual_keyboard =
|
||||
last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH;
|
||||
last_pointer_type_ == ui::EventPointerType::kTouch;
|
||||
if (dismiss_virtual_keyboard && !editable && virtual_keyboard_requested_ &&
|
||||
window_) {
|
||||
virtual_keyboard_requested_ = false;
|
||||
@ -2424,12 +2424,11 @@ void RenderWidgetHostViewAura::OnUpdateTextInputStateCalled(
|
||||
state->mode != ui::TEXT_INPUT_MODE_NONE) {
|
||||
bool show_virtual_keyboard = true;
|
||||
#if defined(OS_FUCHSIA)
|
||||
show_virtual_keyboard =
|
||||
last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH;
|
||||
show_virtual_keyboard = last_pointer_type_ == ui::EventPointerType::kTouch;
|
||||
#elif defined(OS_WIN)
|
||||
show_virtual_keyboard =
|
||||
last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH ||
|
||||
last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_PEN;
|
||||
last_pointer_type_ == ui::EventPointerType::kTouch ||
|
||||
last_pointer_type_ == ui::EventPointerType::kPen;
|
||||
#endif
|
||||
|
||||
#if !defined(OS_WIN)
|
||||
|
@ -672,12 +672,11 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
||||
uint32_t latest_capture_sequence_number_ = 0u;
|
||||
|
||||
// The pointer type of the most recent gesture/mouse/touch event.
|
||||
ui::EventPointerType last_pointer_type_ =
|
||||
ui::EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
ui::EventPointerType last_pointer_type_ = ui::EventPointerType::kUnknown;
|
||||
// The pointer type that caused the most recent focus. This value will be
|
||||
// incorrect if the focus was not triggered by a user gesture.
|
||||
ui::EventPointerType last_pointer_type_before_focus_ =
|
||||
ui::EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
ui::EventPointerType::kUnknown;
|
||||
|
||||
bool is_first_navigation_ = true;
|
||||
viz::LocalSurfaceIdAllocation inset_surface_id_allocation_;
|
||||
|
@ -1377,15 +1377,15 @@ TEST_F(RenderWidgetHostViewAuraTest, TouchEventState) {
|
||||
widget_host_->OnMessageReceived(
|
||||
WidgetHostMsg_HasTouchEventHandlers(0, false));
|
||||
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(20, 20), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(20, 20),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
// The touch events should get forwarded from the view but only the discrete
|
||||
// events should make it all the way to the renderer.
|
||||
@ -1454,18 +1454,18 @@ TEST_F(RenderWidgetHostViewAuraTest, TouchEventState) {
|
||||
events = GetAndResetDispatchedMessages();
|
||||
EXPECT_EQ(0U, events.size());
|
||||
|
||||
ui::TouchEvent move2(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(20, 20), base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20),
|
||||
base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
view_->OnTouchEvent(&move2);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
EXPECT_TRUE(press.synchronous_handling_disabled());
|
||||
EXPECT_EQ(ui::MotionEvent::Action::MOVE, pointer_state().GetAction());
|
||||
EXPECT_EQ(1U, pointer_state().GetPointerCount());
|
||||
|
||||
ui::TouchEvent release2(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20),
|
||||
base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
view_->OnTouchEvent(&release2);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
EXPECT_TRUE(press.synchronous_handling_disabled());
|
||||
@ -2359,9 +2359,9 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
|
||||
view_->Show();
|
||||
view_->UseFakeDispatcher();
|
||||
|
||||
ui::TouchEvent press0(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press0(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
view_->OnTouchEvent(&press0);
|
||||
view_->GetFocusedWidget()->input_router()->OnSetTouchAction(
|
||||
@ -2377,9 +2377,9 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
|
||||
EXPECT_EQ(1U, pointer_state().GetPointerCount());
|
||||
EXPECT_EQ(1U, view_->dispatcher_->GetAndResetProcessedTouchEventCount());
|
||||
|
||||
ui::TouchEvent move0(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(20, 20), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move0(ui::ET_TOUCH_MOVED, gfx::Point(20, 20),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
view_->OnTouchEvent(&move0);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -2393,9 +2393,9 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
|
||||
|
||||
// For the second touchstart, only the state of the second touch point is
|
||||
// StatePressed, the state of the first touch point is StateStationary.
|
||||
ui::TouchEvent press1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
view_->OnTouchEvent(&press1);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -2410,9 +2410,9 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
|
||||
|
||||
// For the touchmove of second point, the state of the second touch point is
|
||||
// StateMoved, the state of the first touch point is StateStationary.
|
||||
ui::TouchEvent move1(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(30, 30), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(30, 30),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
view_->OnTouchEvent(&move1);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -2426,9 +2426,9 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
|
||||
|
||||
// For the touchmove of first point, the state of the first touch point is
|
||||
// StateMoved, the state of the second touch point is StateStationary.
|
||||
ui::TouchEvent move2(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(10, 10),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
view_->OnTouchEvent(&move2);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -2440,9 +2440,9 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
|
||||
EXPECT_EQ(2U, pointer_state().GetPointerCount());
|
||||
EXPECT_EQ(1U, view_->dispatcher_->GetAndResetProcessedTouchEventCount());
|
||||
|
||||
ui::TouchEvent cancel0(
|
||||
ui::ET_TOUCH_CANCELLED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent cancel0(ui::ET_TOUCH_CANCELLED, gfx::Point(10, 10),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
// For the touchcancel, only the state of the current touch point is
|
||||
// StateCancelled, the state of the other touch point is StateStationary.
|
||||
@ -2453,9 +2453,9 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
|
||||
EXPECT_EQ(1U, pointer_state().GetPointerCount());
|
||||
EXPECT_EQ(1U, view_->dispatcher_->GetAndResetProcessedTouchEventCount());
|
||||
|
||||
ui::TouchEvent cancel1(
|
||||
ui::ET_TOUCH_CANCELLED, gfx::Point(30, 30), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent cancel1(ui::ET_TOUCH_CANCELLED, gfx::Point(30, 30),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
view_->OnTouchEvent(&cancel1);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -2473,15 +2473,15 @@ TEST_F(RenderWidgetHostViewAuraTest, TouchEventSyncAsync) {
|
||||
|
||||
widget_host_->OnMessageReceived(WidgetHostMsg_HasTouchEventHandlers(0, true));
|
||||
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(20, 20), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(20, 20),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
view_->OnTouchEvent(&press);
|
||||
EXPECT_TRUE(press.synchronous_handling_disabled());
|
||||
@ -3352,15 +3352,15 @@ TEST_F(RenderWidgetHostViewAuraTest, SourceEventTypeExistsInLatencyInfo) {
|
||||
ui::SourceEventType::WHEEL);
|
||||
|
||||
// TOUCH source exists.
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(20, 20), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(20, 20),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
view_->OnTouchEvent(&press);
|
||||
view_->OnTouchEvent(&move);
|
||||
EXPECT_EQ(widget_host_->lastWheelOrTouchEventLatencyInfo.source_event_type(),
|
||||
@ -3429,9 +3429,9 @@ TEST_F(RenderWidgetHostViewAuraTest, TouchEventPositionsArentRounded) {
|
||||
view_->InitAsChild(nullptr);
|
||||
view_->Show();
|
||||
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
press.set_location_f(gfx::PointF(kX, kY));
|
||||
press.set_root_location_f(gfx::PointF(kX, kY));
|
||||
|
||||
@ -4938,14 +4938,14 @@ TEST_F(RenderWidgetHostViewAuraTest,
|
||||
|
||||
widget_host_->OnMessageReceived(WidgetHostMsg_HasTouchEventHandlers(0, true));
|
||||
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
// Construct a move with a touch id which doesn't exist.
|
||||
ui::TouchEvent invalid_move(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(30, 30), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
// Valid press is handled asynchronously.
|
||||
view_->OnTouchEvent(&press);
|
||||
@ -5080,9 +5080,9 @@ TEST_F(RenderWidgetHostViewAuraTest, CorrectNumberOfAcksAreDispatched) {
|
||||
view_->Show();
|
||||
view_->UseFakeDispatcher();
|
||||
|
||||
ui::TouchEvent press1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
view_->OnTouchEvent(&press1);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -5092,9 +5092,9 @@ TEST_F(RenderWidgetHostViewAuraTest, CorrectNumberOfAcksAreDispatched) {
|
||||
events[1]->ToEvent()->CallCallback(
|
||||
blink::mojom::InputEventResultState::kConsumed);
|
||||
|
||||
ui::TouchEvent press2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
view_->OnTouchEvent(&press2);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
events = GetAndResetDispatchedMessages();
|
||||
@ -6221,8 +6221,7 @@ TEST_F(RenderWidgetHostViewAuraTest, FocusReasonTouch) {
|
||||
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN);
|
||||
tap_details.set_primary_pointer_type(
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kTouch);
|
||||
ui::GestureEvent touch_event(0, 0, 0, base::TimeTicks(), tap_details);
|
||||
|
||||
parent_view_->OnGestureEvent(&touch_event);
|
||||
@ -6238,7 +6237,7 @@ TEST_F(RenderWidgetHostViewAuraTest, FocusReasonPen) {
|
||||
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kPen);
|
||||
ui::GestureEvent pen_event(0, 0, 0, base::TimeTicks(), tap_details);
|
||||
|
||||
parent_view_->OnGestureEvent(&pen_event);
|
||||
@ -6256,8 +6255,7 @@ TEST_F(RenderWidgetHostViewAuraTest, FocusReasonMultipleEventsOnSameNode) {
|
||||
{
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN);
|
||||
tap_details.set_primary_pointer_type(
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kTouch);
|
||||
ui::GestureEvent touch_event(0, 0, 0, base::TimeTicks(), tap_details);
|
||||
|
||||
parent_view_->OnGestureEvent(&touch_event);
|
||||
@ -6267,8 +6265,7 @@ TEST_F(RenderWidgetHostViewAuraTest, FocusReasonMultipleEventsOnSameNode) {
|
||||
{
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN);
|
||||
tap_details.set_primary_pointer_type(
|
||||
ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kPen);
|
||||
ui::GestureEvent pen_event(0, 0, 0, base::TimeTicks(), tap_details);
|
||||
|
||||
parent_view_->OnGestureEvent(&pen_event);
|
||||
@ -6421,7 +6418,7 @@ class RenderWidgetHostViewAuraKeyboardTest
|
||||
};
|
||||
|
||||
TEST_F(RenderWidgetHostViewAuraKeyboardTest, KeyboardObserverDestroyed) {
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_TOUCH);
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::kTouch);
|
||||
ActivateViewForTextInputManager(parent_view_, ui::TEXT_INPUT_TYPE_TEXT);
|
||||
EXPECT_NE(parent_view_->keyboard_observer_.get(), nullptr);
|
||||
EXPECT_EQ(keyboard_controller_observer_count(), 1u);
|
||||
@ -6438,7 +6435,7 @@ TEST_F(RenderWidgetHostViewAuraKeyboardTest, NoKeyboardObserverForMouseInput) {
|
||||
// removed after it has been registered with a touch input and we received a
|
||||
// mouse event.
|
||||
// Do not show virtual keyboard for mouse inputs.
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_MOUSE);
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::kMouse);
|
||||
ActivateViewForTextInputManager(parent_view_, ui::TEXT_INPUT_TYPE_TEXT);
|
||||
EXPECT_EQ(parent_view_->keyboard_observer_.get(), nullptr);
|
||||
EXPECT_EQ(keyboard_controller_observer_count(), 0u);
|
||||
@ -6448,7 +6445,7 @@ TEST_F(RenderWidgetHostViewAuraKeyboardTest, NoKeyboardObserverForMouseInput) {
|
||||
TEST_F(RenderWidgetHostViewAuraKeyboardTest,
|
||||
KeyboardObserverForOnlyTouchInput) {
|
||||
// Show virtual keyboard for touch inputs.
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_TOUCH);
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::kTouch);
|
||||
ActivateViewForTextInputManager(parent_view_, ui::TEXT_INPUT_TYPE_TEXT);
|
||||
EXPECT_NE(parent_view_->keyboard_observer_.get(), nullptr);
|
||||
EXPECT_EQ(keyboard_controller_observer_count(), 1u);
|
||||
@ -6458,7 +6455,7 @@ TEST_F(RenderWidgetHostViewAuraKeyboardTest,
|
||||
TEST_F(RenderWidgetHostViewAuraKeyboardTest,
|
||||
KeyboardObserverForFocusedNodeChanged) {
|
||||
// Show virtual keyboard for touch inputs.
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_TOUCH);
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::kTouch);
|
||||
ActivateViewForTextInputManager(parent_view_, ui::TEXT_INPUT_TYPE_TEXT);
|
||||
EXPECT_EQ(IsKeyboardVisible(), true);
|
||||
EXPECT_NE(parent_view_->keyboard_observer_.get(), nullptr);
|
||||
@ -6478,7 +6475,7 @@ TEST_F(RenderWidgetHostViewAuraKeyboardTest,
|
||||
|
||||
TEST_F(RenderWidgetHostViewAuraKeyboardTest, KeyboardObserverForPenInput) {
|
||||
// Show virtual keyboard for pen inputs.
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
parent_view_->SetLastPointerType(ui::EventPointerType::kPen);
|
||||
ActivateViewForTextInputManager(parent_view_, ui::TEXT_INPUT_TYPE_TEXT);
|
||||
EXPECT_NE(parent_view_->keyboard_observer_.get(), nullptr);
|
||||
EXPECT_EQ(keyboard_controller_observer_count(), 1u);
|
||||
|
@ -78,7 +78,7 @@ bool MakeUITouchEventsFromWebTouchEvents(
|
||||
location = point.PositionInScreen();
|
||||
auto uievent = std::make_unique<ui::TouchEvent>(
|
||||
type, gfx::Point(), timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, point.id,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, point.id,
|
||||
point.radius_x, point.radius_y, point.force,
|
||||
point.rotation_angle),
|
||||
flags);
|
||||
|
@ -2465,7 +2465,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
.ExtractInt();
|
||||
const int inset_height = 200;
|
||||
parent_render_widget_host_aura->SetLastPointerType(
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH);
|
||||
ui::EventPointerType::kTouch);
|
||||
parent_render_widget_host_aura->SetInsets(gfx::Insets(0, 0, inset_height, 0));
|
||||
|
||||
// After focus on editable element, we expect element to be scrolled
|
||||
@ -4725,13 +4725,13 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
observer.Wait();
|
||||
}
|
||||
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, child_center, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 30.0f,
|
||||
/* radius_y */ 30.0f,
|
||||
/* force */ 0.0f));
|
||||
ui::TouchEvent touch_event(ui::ET_TOUCH_PRESSED, child_center,
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 30.0f,
|
||||
/* radius_y */ 30.0f,
|
||||
/* force */ 0.0f));
|
||||
UpdateEventRootLocation(&touch_event, rwhv);
|
||||
rwhv->OnTouchEvent(&touch_event);
|
||||
waiter.Wait();
|
||||
@ -4796,13 +4796,13 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
observer->Wait();
|
||||
}
|
||||
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, frame_center, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 30.0f,
|
||||
/* radius_y */ 30.0f,
|
||||
/* force */ 0.0f));
|
||||
ui::TouchEvent touch_event(ui::ET_TOUCH_PRESSED, frame_center,
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 30.0f,
|
||||
/* radius_y */ 30.0f,
|
||||
/* force */ 0.0f));
|
||||
UpdateEventRootLocation(&touch_event, rwhv);
|
||||
rwhv->OnTouchEvent(&touch_event);
|
||||
{
|
||||
@ -4906,7 +4906,7 @@ uint32_t SendTouchTapWithExpectedTarget(
|
||||
}
|
||||
ui::TouchEvent touch_event_pressed(
|
||||
ui::ET_TOUCH_PRESSED, touch_point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 30.0f,
|
||||
/* radius_y */ 30.0f,
|
||||
@ -4923,7 +4923,7 @@ uint32_t SendTouchTapWithExpectedTarget(
|
||||
EXPECT_EQ(expected_target, router_touch_target);
|
||||
ui::TouchEvent touch_event_released(
|
||||
ui::ET_TOUCH_RELEASED, touch_point, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 30.0f,
|
||||
/* radius_y */ 30.0f,
|
||||
@ -6069,7 +6069,7 @@ class SitePerProcessGestureHitTestBrowserTest
|
||||
// will crash in the renderer otherwise.
|
||||
ui::TouchEvent touch_pressed(
|
||||
ui::ET_TOUCH_PRESSED, position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 1.0f,
|
||||
/* radius_y */ 1.0f,
|
||||
@ -6134,7 +6134,7 @@ class SitePerProcessGestureHitTestBrowserTest
|
||||
// after pinch gestures.
|
||||
ui::TouchEvent touch_released(
|
||||
ui::ET_TOUCH_RELEASED, position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 1.0f,
|
||||
/* radius_y */ 1.0f,
|
||||
|
@ -473,7 +473,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED,
|
||||
gfx::Point(bounds.x() + bounds.width() / 2, bounds.y() + 5), timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::EventDispatchDetails details = sink->OnEventFromSource(&press);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
EXPECT_EQ(1, GetCurrentIndex());
|
||||
@ -481,8 +481,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
|
||||
timestamp += base::TimeDelta::FromMilliseconds(10);
|
||||
ui::TouchEvent move1(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(bounds.right() - 10, bounds.y() + 5),
|
||||
timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
timestamp, ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
details = sink->OnEventFromSource(&move1);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
EXPECT_EQ(1, GetCurrentIndex());
|
||||
@ -492,9 +491,9 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
|
||||
|
||||
for (int x = bounds.right() - 10; x >= bounds.x() + 10; x-= 10) {
|
||||
timestamp += base::TimeDelta::FromMilliseconds(10);
|
||||
ui::TouchEvent inc(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5), timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent inc(ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5),
|
||||
timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
details = sink->OnEventFromSource(&inc);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
EXPECT_EQ(1, GetCurrentIndex());
|
||||
@ -502,9 +501,9 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
|
||||
|
||||
for (int x = bounds.x() + 10; x <= bounds.width() - 10; x+= 10) {
|
||||
timestamp += base::TimeDelta::FromMilliseconds(10);
|
||||
ui::TouchEvent inc(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5), timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent inc(ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5),
|
||||
timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
details = sink->OnEventFromSource(&inc);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
EXPECT_EQ(1, GetCurrentIndex());
|
||||
@ -512,9 +511,9 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
|
||||
|
||||
for (int x = bounds.width() - 10; x >= bounds.x() + 10; x-= 10) {
|
||||
timestamp += base::TimeDelta::FromMilliseconds(10);
|
||||
ui::TouchEvent inc(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5), timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent inc(ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5),
|
||||
timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
details = sink->OnEventFromSource(&inc);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
EXPECT_EQ(1, GetCurrentIndex());
|
||||
|
@ -1148,9 +1148,8 @@ void SimulateTapWithModifiersAt(WebContents* web_contents,
|
||||
|
||||
#if defined(USE_AURA)
|
||||
void SimulateTouchPressAt(WebContents* web_contents, const gfx::Point& point) {
|
||||
ui::TouchEvent touch(
|
||||
ui::ET_TOUCH_PRESSED, point, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, point, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
static_cast<RenderWidgetHostViewAura*>(
|
||||
web_contents->GetRenderWidgetHostView())
|
||||
->OnTouchEvent(&touch);
|
||||
@ -1162,7 +1161,7 @@ void SimulateLongTapAt(WebContents* web_contents, const gfx::Point& point) {
|
||||
|
||||
ui::TouchEvent touch_start(
|
||||
ui::ET_TOUCH_PRESSED, point, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_start);
|
||||
|
||||
ui::GestureEventDetails tap_down_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
@ -1178,9 +1177,8 @@ void SimulateLongTapAt(WebContents* web_contents, const gfx::Point& point) {
|
||||
touch_start.unique_event_id());
|
||||
rwhva->OnGestureEvent(&long_press);
|
||||
|
||||
ui::TouchEvent touch_end(
|
||||
ui::ET_TOUCH_RELEASED, point, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch_end(ui::ET_TOUCH_RELEASED, point, base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_end);
|
||||
|
||||
ui::GestureEventDetails long_tap_details(ui::ET_GESTURE_LONG_TAP);
|
||||
@ -2285,11 +2283,10 @@ void SendRoutedTouchTapSequence(content::WebContents* web_contents,
|
||||
web_contents->GetRenderWidgetHostView());
|
||||
ui::TouchEvent touch_start(
|
||||
ui::ET_TOUCH_PRESSED, point, base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_start);
|
||||
ui::TouchEvent touch_end(
|
||||
ui::ET_TOUCH_RELEASED, point, base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch_end(ui::ET_TOUCH_RELEASED, point, base::TimeTicks::Now(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
rwhva->OnTouchEvent(&touch_end);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -313,8 +313,8 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
|
||||
int id,
|
||||
int64_t display_id,
|
||||
base::OnceClosure closure) {
|
||||
ui::PointerDetails details(ui::EventPointerType::POINTER_TYPE_TOUCH, id,
|
||||
1.0f, 1.0f, 0.0f);
|
||||
ui::PointerDetails details(ui::EventPointerType::kTouch, id, 1.0f, 1.0f,
|
||||
0.0f);
|
||||
ui::TouchEvent touch_event(type, host_location, host_location,
|
||||
ui::EventTimeForNow(), details);
|
||||
SendEventToSink(&touch_event, display_id, std::move(closure));
|
||||
|
@ -166,7 +166,7 @@ TEST_F(WindowEventDispatcherTest, RepostEvent) {
|
||||
|
||||
ui::TouchEvent touch_pressed_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
host()->dispatcher()->RepostEvent(&touch_pressed_event);
|
||||
RunAllPendingInMessageLoop();
|
||||
EXPECT_TRUE(Env::GetInstance()->is_touch_down());
|
||||
@ -182,16 +182,16 @@ TEST_F(WindowEventDispatcherTest, TouchDownState) {
|
||||
|
||||
ui::TouchEvent touch_pressed_event1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent touch_pressed_event2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
ui::TouchEvent touch_released_event1(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::TouchEvent touch_released_event2(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
|
||||
EXPECT_FALSE(Env::GetInstance()->is_touch_down());
|
||||
host()->dispatcher()->OnEventFromSource(&touch_pressed_event1);
|
||||
@ -438,18 +438,16 @@ TEST_F(WindowEventDispatcherTest, TouchEventsOutsideBounds) {
|
||||
|
||||
gfx::Point position = root_window()->bounds().origin();
|
||||
position.Offset(-10, -10);
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press);
|
||||
EXPECT_EQ(1, handler.num_touch_events());
|
||||
|
||||
position = root_window()->bounds().origin();
|
||||
position.Offset(root_window()->bounds().width() + 10,
|
||||
root_window()->bounds().height() + 10);
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&release);
|
||||
EXPECT_EQ(2, handler.num_touch_events());
|
||||
root_window()->RemovePreTargetHandler(&handler);
|
||||
@ -837,7 +835,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeld) {
|
||||
// test.
|
||||
ui::TouchEvent touch_pressed_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&touch_pressed_event);
|
||||
recorder.WaitUntilReceivedEvent(ui::ET_GESTURE_SHOW_PRESS);
|
||||
recorder.Reset();
|
||||
@ -847,13 +845,13 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeld) {
|
||||
// Check that we don't immediately dispatch the TOUCH_MOVED event.
|
||||
ui::TouchEvent touch_moved_event(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent touch_moved_event2(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(11, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent touch_moved_event3(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(12, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
DispatchEventUsingWindowDispatcher(&touch_moved_event);
|
||||
EXPECT_TRUE(recorder.events().empty());
|
||||
@ -872,7 +870,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeld) {
|
||||
// immediately before it.
|
||||
ui::TouchEvent touch_released_event(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
recorder.Reset();
|
||||
host()->dispatcher()->HoldPointerMoves();
|
||||
DispatchEventUsingWindowDispatcher(&touch_moved_event3);
|
||||
@ -1058,19 +1056,17 @@ TEST_F(WindowEventDispatcherTest, HeldTouchMoveContributesToGesture) {
|
||||
root_window()->AddPreTargetHandler(&recorder);
|
||||
|
||||
const gfx::Point location(20, 20);
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press);
|
||||
EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_TOUCH_PRESSED));
|
||||
recorder.Reset();
|
||||
|
||||
host()->dispatcher()->HoldPointerMoves();
|
||||
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, location + gfx::Vector2d(100, 100),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, location + gfx::Vector2d(100, 100),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&move);
|
||||
EXPECT_FALSE(recorder.HasReceivedEvent(ui::ET_TOUCH_MOVED));
|
||||
EXPECT_FALSE(recorder.HasReceivedEvent(ui::ET_GESTURE_SCROLL_BEGIN));
|
||||
@ -1997,9 +1993,8 @@ TEST_F(WindowEventDispatcherTest, WindowHideCancelsActiveTouches) {
|
||||
&delegate, 1, gfx::Rect(0, 0, 100, 100), root_window()));
|
||||
|
||||
gfx::Point position1 = root_window()->bounds().origin();
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, position1, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, position1, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press);
|
||||
|
||||
EXPECT_EQ("TOUCH_PRESSED GESTURE_BEGIN GESTURE_TAP_DOWN",
|
||||
@ -2024,19 +2019,16 @@ TEST_F(WindowEventDispatcherTest, WindowHideCancelsActiveGestures) {
|
||||
|
||||
gfx::Point position1 = root_window()->bounds().origin();
|
||||
gfx::Point position2 = root_window()->bounds().CenterPoint();
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, position1, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, position1, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press);
|
||||
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, position2, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, position2, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&move);
|
||||
|
||||
ui::TouchEvent press2(
|
||||
ui::ET_TOUCH_PRESSED, position1, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, position1, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
DispatchEventUsingWindowDispatcher(&press2);
|
||||
|
||||
// TODO(tdresser): once the unified Gesture Recognizer has stuck, remove the
|
||||
@ -2132,15 +2124,13 @@ TEST_F(WindowEventDispatcherTest, EndingEventDoesntRetarget) {
|
||||
window2->AddPreTargetHandler(&recorder2);
|
||||
|
||||
gfx::Point position = window1->bounds().origin();
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press);
|
||||
|
||||
gfx::Point position2 = window1->bounds().CenterPoint();
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, position2, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, position2, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&move);
|
||||
|
||||
window2->SetCapture();
|
||||
@ -2886,7 +2876,7 @@ TEST_F(WindowEventDispatcherTest, GestureEventCoordinates) {
|
||||
|
||||
ui::TouchEvent touch_pressed_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
touch_pressed_event.set_location_f(gfx::PointF(kX, kY));
|
||||
touch_pressed_event.set_root_location_f(gfx::PointF(kX, kY));
|
||||
|
||||
@ -2909,18 +2899,16 @@ TEST_F(WindowEventDispatcherTest, TouchMovesMarkedWhenCausingScroll) {
|
||||
root_window()->AddPreTargetHandler(&recorder);
|
||||
|
||||
const gfx::Point location(20, 20);
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press);
|
||||
EXPECT_FALSE(recorder.LastTouchMayCauseScrolling());
|
||||
EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_TOUCH_PRESSED));
|
||||
recorder.Reset();
|
||||
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, location + gfx::Vector2d(100, 100),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, location + gfx::Vector2d(100, 100),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&move);
|
||||
EXPECT_TRUE(recorder.LastTouchMayCauseScrolling());
|
||||
EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_TOUCH_MOVED));
|
||||
@ -2928,10 +2916,9 @@ TEST_F(WindowEventDispatcherTest, TouchMovesMarkedWhenCausingScroll) {
|
||||
EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_GESTURE_SCROLL_UPDATE));
|
||||
recorder.Reset();
|
||||
|
||||
ui::TouchEvent move2(
|
||||
ui::ET_TOUCH_MOVED, location + gfx::Vector2d(200, 200),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move2(ui::ET_TOUCH_MOVED, location + gfx::Vector2d(200, 200),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&move2);
|
||||
EXPECT_TRUE(recorder.LastTouchMayCauseScrolling());
|
||||
EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_TOUCH_MOVED));
|
||||
@ -2942,7 +2929,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesMarkedWhenCausingScroll) {
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, location + gfx::Vector2d(200, 200),
|
||||
ui::EventTimeForNow() + base::TimeDelta::FromSeconds(1),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&release);
|
||||
EXPECT_TRUE(recorder.LastTouchMayCauseScrolling());
|
||||
EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_TOUCH_RELEASED));
|
||||
@ -3060,10 +3047,10 @@ TEST_F(WindowEventDispatcherTest, TouchEventWithScaledWindow) {
|
||||
const gfx::Point touch_position(-5, -5);
|
||||
ui::TouchEvent pressed_event(
|
||||
ui::ET_TOUCH_PRESSED, touch_position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent released_event(
|
||||
ui::ET_TOUCH_RELEASED, touch_position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
dispatcher->OnEventFromSource(&pressed_event);
|
||||
dispatcher->OnEventFromSource(&released_event);
|
||||
EXPECT_EQ(expected_events, EventTypesToString(root_recorder.events()));
|
||||
@ -3078,10 +3065,10 @@ TEST_F(WindowEventDispatcherTest, TouchEventWithScaledWindow) {
|
||||
const gfx::Point touch_position(5, 5);
|
||||
ui::TouchEvent pressed_event(
|
||||
ui::ET_TOUCH_PRESSED, touch_position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
ui::TouchEvent released_event(
|
||||
ui::ET_TOUCH_RELEASED, touch_position, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
dispatcher->OnEventFromSource(&pressed_event);
|
||||
dispatcher->OnEventFromSource(&released_event);
|
||||
EXPECT_EQ(expected_events, EventTypesToString(root_recorder.events()));
|
||||
|
@ -817,9 +817,8 @@ TEST_F(WindowTest, CaptureTests) {
|
||||
EXPECT_EQ(2, delegate.mouse_event_count());
|
||||
delegate.ResetCounts();
|
||||
|
||||
ui::TouchEvent touchev(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touchev(ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&touchev);
|
||||
EXPECT_EQ(1, delegate.touch_event_count());
|
||||
delegate.ResetCounts();
|
||||
@ -834,9 +833,8 @@ TEST_F(WindowTest, CaptureTests) {
|
||||
generator.PressLeftButton();
|
||||
EXPECT_EQ(1, delegate.mouse_event_count());
|
||||
|
||||
ui::TouchEvent touchev2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(250, 250), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent touchev2(ui::ET_TOUCH_PRESSED, gfx::Point(250, 250), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
DispatchEventUsingWindowDispatcher(&touchev2);
|
||||
EXPECT_EQ(0, delegate.touch_event_count());
|
||||
|
||||
@ -858,9 +856,8 @@ TEST_F(WindowTest, TouchCaptureCancelsOtherTouches) {
|
||||
&delegate2, 0, gfx::Rect(50, 50, 50, 50), root_window()));
|
||||
|
||||
// Press on w1.
|
||||
ui::TouchEvent press1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press1);
|
||||
// We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN.
|
||||
EXPECT_EQ(2, delegate1.gesture_event_count());
|
||||
@ -873,27 +870,24 @@ TEST_F(WindowTest, TouchCaptureCancelsOtherTouches) {
|
||||
delegate1.ResetCounts();
|
||||
delegate2.ResetCounts();
|
||||
|
||||
// Events are now untargetted.
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(10, 20), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
// Events are now untargeted.
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&move);
|
||||
EXPECT_EQ(0, delegate1.gesture_event_count());
|
||||
EXPECT_EQ(0, delegate1.touch_event_count());
|
||||
EXPECT_EQ(0, delegate2.gesture_event_count());
|
||||
EXPECT_EQ(0, delegate2.touch_event_count());
|
||||
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&release);
|
||||
EXPECT_EQ(0, delegate1.gesture_event_count());
|
||||
EXPECT_EQ(0, delegate2.gesture_event_count());
|
||||
|
||||
// A new press is captured by w2.
|
||||
ui::TouchEvent press2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press2);
|
||||
EXPECT_EQ(0, delegate1.gesture_event_count());
|
||||
// We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN.
|
||||
@ -916,9 +910,8 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) {
|
||||
base::TimeTicks time = getTime();
|
||||
const int kTimeDelta = 100;
|
||||
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press);
|
||||
|
||||
// We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN.
|
||||
@ -934,9 +927,8 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) {
|
||||
// On move We will get TOUCH_MOVED, GESTURE_TAP_CANCEL,
|
||||
// GESTURE_SCROLL_START and GESTURE_SCROLL_UPDATE.
|
||||
time += base::TimeDelta::FromMilliseconds(kTimeDelta);
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(10, 20), time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), time,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&move);
|
||||
EXPECT_EQ(1, delegate.touch_event_count());
|
||||
EXPECT_EQ(3, delegate.gesture_event_count());
|
||||
@ -950,9 +942,8 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) {
|
||||
|
||||
// On move we still get TOUCH_MOVED and GESTURE_SCROLL_UPDATE.
|
||||
time += base::TimeDelta::FromMilliseconds(kTimeDelta);
|
||||
ui::TouchEvent move2(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(10, 30), time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(10, 30), time,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&move2);
|
||||
EXPECT_EQ(1, delegate.touch_event_count());
|
||||
EXPECT_EQ(1, delegate.gesture_event_count());
|
||||
@ -960,9 +951,8 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) {
|
||||
|
||||
// And on release we get TOUCH_RELEASED, GESTURE_SCROLL_END, GESTURE_END
|
||||
time += base::TimeDelta::FromMilliseconds(kTimeDelta);
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), time,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&release);
|
||||
EXPECT_EQ(1, delegate.touch_event_count());
|
||||
EXPECT_EQ(2, delegate.gesture_event_count());
|
||||
@ -974,9 +964,8 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) {
|
||||
CaptureWindowDelegateImpl d1;
|
||||
std::unique_ptr<Window> w1(CreateTestWindowWithDelegate(
|
||||
&d1, 0, gfx::Rect(0, 0, 20, 20), root_window()));
|
||||
ui::TouchEvent p1(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent p1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&p1);
|
||||
// We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN.
|
||||
EXPECT_EQ(1, d1.touch_event_count());
|
||||
@ -987,9 +976,8 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) {
|
||||
CaptureWindowDelegateImpl d2;
|
||||
std::unique_ptr<Window> w2(CreateTestWindowWithDelegate(
|
||||
&d2, 0, gfx::Rect(40, 0, 40, 20), root_window()));
|
||||
ui::TouchEvent p2(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(41, 10), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent p2(ui::ET_TOUCH_PRESSED, gfx::Point(41, 10), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
DispatchEventUsingWindowDispatcher(&p2);
|
||||
EXPECT_EQ(0, d1.touch_event_count());
|
||||
EXPECT_EQ(0, d1.gesture_event_count());
|
||||
@ -1024,9 +1012,8 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) {
|
||||
|
||||
// Move touch id originally associated with |w2|. The touch has been
|
||||
// cancelled, so no events should be dispatched.
|
||||
ui::TouchEvent m3(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(110, 105), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent m3(ui::ET_TOUCH_MOVED, gfx::Point(110, 105), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
DispatchEventUsingWindowDispatcher(&m3);
|
||||
EXPECT_EQ(0, d1.touch_event_count());
|
||||
EXPECT_EQ(0, d1.gesture_event_count());
|
||||
@ -1045,9 +1032,8 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) {
|
||||
EXPECT_EQ(0, d3.gesture_event_count());
|
||||
|
||||
// The touch has been cancelled, so no events are dispatched.
|
||||
ui::TouchEvent m4(
|
||||
ui::ET_TOUCH_MOVED, gfx::Point(120, 105), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent m4(ui::ET_TOUCH_MOVED, gfx::Point(120, 105), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
DispatchEventUsingWindowDispatcher(&m4);
|
||||
EXPECT_EQ(0, d1.touch_event_count());
|
||||
EXPECT_EQ(0, d1.gesture_event_count());
|
||||
@ -1688,9 +1674,9 @@ TEST_F(WindowTest, TransformGesture) {
|
||||
host()->SetRootTransform(OverlayTransformToTransform(
|
||||
gfx::OVERLAY_TRANSFORM_ROTATE_90, gfx::SizeF(size)));
|
||||
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(size.height() - 10, 10), getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(size.height() - 10, 10),
|
||||
getTime(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
DispatchEventUsingWindowDispatcher(&press);
|
||||
EXPECT_EQ(gfx::Point(10, 10).ToString(), delegate->position().ToString());
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ TEST_F(UserActivityDetectorTest, Basic) {
|
||||
AdvanceTime(advance_delta);
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(), base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
OnEvent(&touch_event);
|
||||
EXPECT_FALSE(touch_event.handled());
|
||||
EXPECT_EQ(now_, detector_->last_activity_time());
|
||||
|
@ -127,15 +127,15 @@ WebPointerProperties::PointerType ToWebPointerType(
|
||||
WebPointerProperties::PointerType ToWebPointerType(
|
||||
EventPointerType event_pointer_type) {
|
||||
switch (event_pointer_type) {
|
||||
case EventPointerType::POINTER_TYPE_UNKNOWN:
|
||||
case EventPointerType::kUnknown:
|
||||
return WebPointerProperties::PointerType::kUnknown;
|
||||
case EventPointerType::POINTER_TYPE_MOUSE:
|
||||
case EventPointerType::kMouse:
|
||||
return WebPointerProperties::PointerType::kMouse;
|
||||
case EventPointerType::POINTER_TYPE_PEN:
|
||||
case EventPointerType::kPen:
|
||||
return WebPointerProperties::PointerType::kPen;
|
||||
case EventPointerType::POINTER_TYPE_TOUCH:
|
||||
case EventPointerType::kTouch:
|
||||
return WebPointerProperties::PointerType::kTouch;
|
||||
case EventPointerType::POINTER_TYPE_ERASER:
|
||||
case EventPointerType::kEraser:
|
||||
return WebPointerProperties::PointerType::kEraser;
|
||||
default:
|
||||
NOTREACHED() << "Invalid EventPointerType = "
|
||||
@ -1225,18 +1225,18 @@ EventPointerType WebPointerTypeToEventPointerType(
|
||||
WebPointerProperties::PointerType type) {
|
||||
switch (type) {
|
||||
case WebPointerProperties::PointerType::kMouse:
|
||||
return EventPointerType::POINTER_TYPE_MOUSE;
|
||||
return EventPointerType::kMouse;
|
||||
case WebPointerProperties::PointerType::kPen:
|
||||
return EventPointerType::POINTER_TYPE_PEN;
|
||||
return EventPointerType::kPen;
|
||||
case WebPointerProperties::PointerType::kEraser:
|
||||
return EventPointerType::POINTER_TYPE_ERASER;
|
||||
return EventPointerType::kEraser;
|
||||
case WebPointerProperties::PointerType::kTouch:
|
||||
return EventPointerType::POINTER_TYPE_TOUCH;
|
||||
return EventPointerType::kTouch;
|
||||
case WebPointerProperties::PointerType::kUnknown:
|
||||
return EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
return EventPointerType::kUnknown;
|
||||
}
|
||||
NOTREACHED() << "Invalid pointer type";
|
||||
return EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
return EventPointerType::kUnknown;
|
||||
}
|
||||
|
||||
blink::WebGestureEvent ScrollBeginFromScrollUpdate(
|
||||
|
@ -32,15 +32,15 @@ gfx::PointF GetScreenLocationFromEvent(const LocatedEvent& event) {
|
||||
blink::WebPointerProperties::PointerType EventPointerTypeToWebPointerType(
|
||||
EventPointerType pointer_type) {
|
||||
switch (pointer_type) {
|
||||
case EventPointerType::POINTER_TYPE_UNKNOWN:
|
||||
case EventPointerType::kUnknown:
|
||||
return blink::WebPointerProperties::PointerType::kUnknown;
|
||||
case EventPointerType::POINTER_TYPE_MOUSE:
|
||||
case EventPointerType::kMouse:
|
||||
return blink::WebPointerProperties::PointerType::kMouse;
|
||||
case EventPointerType::POINTER_TYPE_PEN:
|
||||
case EventPointerType::kPen:
|
||||
return blink::WebPointerProperties::PointerType::kPen;
|
||||
case EventPointerType::POINTER_TYPE_ERASER:
|
||||
case EventPointerType::kEraser:
|
||||
return blink::WebPointerProperties::PointerType::kEraser;
|
||||
case EventPointerType::POINTER_TYPE_TOUCH:
|
||||
case EventPointerType::kTouch:
|
||||
return blink::WebPointerProperties::PointerType::kTouch;
|
||||
}
|
||||
NOTREACHED() << "Unexpected EventPointerType";
|
||||
|
@ -405,7 +405,7 @@ TEST(WebInputEventTest, TestMakeWebMouseEvent) {
|
||||
{
|
||||
// Stylus values for PointerDetails.
|
||||
base::TimeTicks timestamp = EventTimeForNow();
|
||||
PointerDetails pointer_details(EventPointerType::POINTER_TYPE_PEN,
|
||||
PointerDetails pointer_details(EventPointerType::kPen,
|
||||
/* id */ 63,
|
||||
/* radius_x */ 0.0f,
|
||||
/* radius_y */ 0.0f,
|
||||
|
@ -126,7 +126,7 @@ int GetChangedMouseButtonFlagsFromNative(const PlatformEvent& native_event) {
|
||||
|
||||
PointerDetails GetMousePointerDetailsFromNative(
|
||||
const PlatformEvent& native_event) {
|
||||
return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE);
|
||||
return PointerDetails(EventPointerType::kMouse);
|
||||
}
|
||||
|
||||
gfx::Vector2d GetMouseWheelOffset(const PlatformEvent& event) {
|
||||
@ -165,7 +165,7 @@ void ClearTouchIdIfReleased(const PlatformEvent& native_event) {
|
||||
PointerDetails GetTouchPointerDetailsFromNative(
|
||||
const PlatformEvent& native_event) {
|
||||
NOTIMPLEMENTED();
|
||||
return PointerDetails(EventPointerType::POINTER_TYPE_UNKNOWN,
|
||||
return PointerDetails(EventPointerType::kUnknown,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 1.0,
|
||||
/* radius_y */ 1.0,
|
||||
|
@ -72,10 +72,10 @@ void TouchFactory::SetTouchDeviceListFromCommandLine() {
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
AddPointerDevicesFromString(
|
||||
command_line->GetSwitchValueASCII(switches::kTouchDevices),
|
||||
EventPointerType::POINTER_TYPE_TOUCH, &devices);
|
||||
EventPointerType::kTouch, &devices);
|
||||
AddPointerDevicesFromString(
|
||||
command_line->GetSwitchValueASCII(switches::kPenDevices),
|
||||
EventPointerType::POINTER_TYPE_PEN, &devices);
|
||||
EventPointerType::kPen, &devices);
|
||||
if (!devices.empty())
|
||||
ui::TouchFactory::GetInstance()->SetTouchDeviceList(devices);
|
||||
}
|
||||
@ -126,8 +126,7 @@ void TouchFactory::UpdateDeviceList(XDisplay* display) {
|
||||
continue;
|
||||
|
||||
touch_device_lookup_[master_id] = true;
|
||||
touch_device_list_[master_id] = {true,
|
||||
EventPointerType::POINTER_TYPE_TOUCH};
|
||||
touch_device_list_[master_id] = {true, EventPointerType::kTouch};
|
||||
|
||||
if (devinfo.use != XIMasterPointer)
|
||||
CacheTouchscreenIds(devinfo.deviceid);
|
||||
@ -135,8 +134,8 @@ void TouchFactory::UpdateDeviceList(XDisplay* display) {
|
||||
if (devinfo.use == XISlavePointer) {
|
||||
device_master_id_list_[devinfo.deviceid] = master_id;
|
||||
touch_device_lookup_[devinfo.deviceid] = true;
|
||||
touch_device_list_[devinfo.deviceid] = {
|
||||
false, EventPointerType::POINTER_TYPE_TOUCH};
|
||||
touch_device_list_[devinfo.deviceid] = {false,
|
||||
EventPointerType::kTouch};
|
||||
}
|
||||
}
|
||||
pointer_device_lookup_[devinfo.deviceid] =
|
||||
@ -318,7 +317,7 @@ void TouchFactory::SetTouchDeviceForTest(
|
||||
for (auto iter = devices.begin(); iter != devices.end(); ++iter) {
|
||||
DCHECK(IsValidDevice(*iter));
|
||||
touch_device_lookup_[*iter] = true;
|
||||
touch_device_list_[*iter] = {true, EventPointerType::POINTER_TYPE_TOUCH};
|
||||
touch_device_list_[*iter] = {true, EventPointerType::kTouch};
|
||||
}
|
||||
SetTouchscreensEnabled(true);
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ class EVENTS_DEVICES_X11_EXPORT TouchFactory {
|
||||
// device is master and multi-touch capable).
|
||||
struct TouchDeviceDetails {
|
||||
bool is_master = false;
|
||||
EventPointerType pointer_type = EventPointerType::POINTER_TYPE_TOUCH;
|
||||
EventPointerType pointer_type = EventPointerType::kTouch;
|
||||
};
|
||||
std::map<int, TouchDeviceDetails> touch_device_list_;
|
||||
|
||||
|
@ -470,8 +470,7 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
|
||||
int flags,
|
||||
int changed_button_flags,
|
||||
const PointerDetails& pointer_details =
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE,
|
||||
kPointerIdMouse));
|
||||
PointerDetails(EventPointerType::kMouse, kPointerIdMouse));
|
||||
|
||||
// DEPRECATED: Prefer constructor that takes gfx::PointF.
|
||||
MouseEvent(EventType type,
|
||||
@ -481,8 +480,7 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
|
||||
int flags,
|
||||
int changed_button_flags,
|
||||
const PointerDetails& pointer_details =
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE,
|
||||
kPointerIdMouse));
|
||||
PointerDetails(EventPointerType::kMouse, kPointerIdMouse));
|
||||
|
||||
MouseEvent(const MouseEvent& copy);
|
||||
~MouseEvent() override;
|
||||
@ -641,7 +639,7 @@ class EVENTS_EXPORT MouseWheelEvent : public MouseEvent {
|
||||
gfx::Vector2d offset_;
|
||||
};
|
||||
|
||||
// NOTE: Pen (stylus) events use TouchEvent with POINTER_TYPE_PEN. They were
|
||||
// NOTE: Pen (stylus) events use TouchEvent with kPen. They were
|
||||
// originally implemented as MouseEvent but switched to TouchEvent when UX
|
||||
// decided not to show hover effects for pen.
|
||||
class EVENTS_EXPORT TouchEvent : public LocatedEvent {
|
||||
|
@ -174,11 +174,12 @@ enum EventDeviceId {
|
||||
|
||||
// Pointing device type.
|
||||
enum class EventPointerType : int {
|
||||
POINTER_TYPE_UNKNOWN = 0,
|
||||
POINTER_TYPE_MOUSE,
|
||||
POINTER_TYPE_PEN,
|
||||
POINTER_TYPE_TOUCH,
|
||||
POINTER_TYPE_ERASER,
|
||||
kUnknown,
|
||||
kMouse,
|
||||
kPen,
|
||||
kTouch,
|
||||
kEraser,
|
||||
kMaxValue = kEraser,
|
||||
};
|
||||
|
||||
// Device type for gesture events.
|
||||
|
@ -560,7 +560,7 @@ TEST(EventTest, TouchEventRadiusDefaultsToOtherAxis) {
|
||||
const float non_zero_length2 = 46;
|
||||
|
||||
TouchEvent event1(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ non_zero_length1,
|
||||
/* radius_y */ 0.0f,
|
||||
@ -569,7 +569,7 @@ TEST(EventTest, TouchEventRadiusDefaultsToOtherAxis) {
|
||||
EXPECT_EQ(non_zero_length1, event1.pointer_details().radius_y);
|
||||
|
||||
TouchEvent event2(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 0.0f,
|
||||
/* radius_y */ non_zero_length2,
|
||||
@ -586,7 +586,7 @@ TEST(EventTest, TouchEventRotationAngleFixing) {
|
||||
{
|
||||
const float angle_in_range = 0;
|
||||
TouchEvent event(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0, radius_x, radius_y,
|
||||
/* force */ 0, angle_in_range),
|
||||
0);
|
||||
@ -596,7 +596,7 @@ TEST(EventTest, TouchEventRotationAngleFixing) {
|
||||
{
|
||||
const float angle_in_range = 179.9f;
|
||||
TouchEvent event(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0, radius_x, radius_y,
|
||||
/* force */ 0, angle_in_range),
|
||||
0);
|
||||
@ -606,7 +606,7 @@ TEST(EventTest, TouchEventRotationAngleFixing) {
|
||||
{
|
||||
const float angle_negative = -0.1f;
|
||||
TouchEvent event(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0, radius_x, radius_y,
|
||||
/* force */ 0, angle_negative),
|
||||
0);
|
||||
@ -616,7 +616,7 @@ TEST(EventTest, TouchEventRotationAngleFixing) {
|
||||
{
|
||||
const float angle_negative = -200;
|
||||
TouchEvent event(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0, radius_x, radius_y,
|
||||
/* force */ 0, angle_negative),
|
||||
0);
|
||||
@ -626,7 +626,7 @@ TEST(EventTest, TouchEventRotationAngleFixing) {
|
||||
{
|
||||
const float angle_too_big = 180;
|
||||
TouchEvent event(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0, radius_x, radius_y,
|
||||
/* force */ 0, angle_too_big),
|
||||
0);
|
||||
@ -636,7 +636,7 @@ TEST(EventTest, TouchEventRotationAngleFixing) {
|
||||
{
|
||||
const float angle_too_big = 400;
|
||||
TouchEvent event(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0, radius_x, radius_y,
|
||||
/* force */ 0, angle_too_big),
|
||||
0);
|
||||
@ -647,9 +647,9 @@ TEST(EventTest, TouchEventRotationAngleFixing) {
|
||||
TEST(EventTest, PointerDetailsTouch) {
|
||||
ui::TouchEvent touch_event_plain(
|
||||
ET_TOUCH_PRESSED, gfx::Point(0, 0), ui::EventTimeForNow(),
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
EXPECT_EQ(EventPointerType::kTouch,
|
||||
touch_event_plain.pointer_details().pointer_type);
|
||||
EXPECT_EQ(0.0f, touch_event_plain.pointer_details().radius_x);
|
||||
EXPECT_EQ(0.0f, touch_event_plain.pointer_details().radius_y);
|
||||
@ -659,13 +659,13 @@ TEST(EventTest, PointerDetailsTouch) {
|
||||
|
||||
ui::TouchEvent touch_event_with_details(
|
||||
ET_TOUCH_PRESSED, gfx::Point(0, 0), ui::EventTimeForNow(),
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 10.0f,
|
||||
/* radius_y */ 5.0f,
|
||||
/* force */ 15.0f));
|
||||
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
EXPECT_EQ(EventPointerType::kTouch,
|
||||
touch_event_with_details.pointer_details().pointer_type);
|
||||
EXPECT_EQ(10.0f, touch_event_with_details.pointer_details().radius_x);
|
||||
EXPECT_EQ(5.0f, touch_event_with_details.pointer_details().radius_y);
|
||||
@ -682,7 +682,7 @@ TEST(EventTest, PointerDetailsMouse) {
|
||||
ui::MouseEvent mouse_event(ET_MOUSE_PRESSED, gfx::Point(0, 0),
|
||||
gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0);
|
||||
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_MOUSE,
|
||||
EXPECT_EQ(EventPointerType::kMouse,
|
||||
mouse_event.pointer_details().pointer_type);
|
||||
EXPECT_EQ(0.0f, mouse_event.pointer_details().radius_x);
|
||||
EXPECT_EQ(0.0f, mouse_event.pointer_details().radius_y);
|
||||
@ -695,7 +695,7 @@ TEST(EventTest, PointerDetailsMouse) {
|
||||
}
|
||||
|
||||
TEST(EventTest, PointerDetailsStylus) {
|
||||
ui::PointerDetails pointer_details(EventPointerType::POINTER_TYPE_PEN,
|
||||
ui::PointerDetails pointer_details(EventPointerType::kPen,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 0.0f,
|
||||
/* radius_y */ 0.0f,
|
||||
@ -708,7 +708,7 @@ TEST(EventTest, PointerDetailsStylus) {
|
||||
ui::MouseEvent stylus_event(ET_MOUSE_PRESSED, gfx::Point(0, 0),
|
||||
gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0,
|
||||
pointer_details);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
EXPECT_EQ(EventPointerType::kPen,
|
||||
stylus_event.pointer_details().pointer_type);
|
||||
EXPECT_EQ(21.0f, stylus_event.pointer_details().force);
|
||||
EXPECT_EQ(45.0f, stylus_event.pointer_details().tilt_x);
|
||||
@ -724,11 +724,11 @@ TEST(EventTest, PointerDetailsStylus) {
|
||||
}
|
||||
|
||||
TEST(EventTest, PointerDetailsCustomTouch) {
|
||||
ui::TouchEvent touch_event(
|
||||
ET_TOUCH_PRESSED, gfx::Point(0, 0), ui::EventTimeForNow(),
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent touch_event(ET_TOUCH_PRESSED, gfx::Point(0, 0),
|
||||
ui::EventTimeForNow(),
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
EXPECT_EQ(EventPointerType::kTouch,
|
||||
touch_event.pointer_details().pointer_type);
|
||||
EXPECT_EQ(0.0f, touch_event.pointer_details().radius_x);
|
||||
EXPECT_EQ(0.0f, touch_event.pointer_details().radius_y);
|
||||
@ -736,7 +736,7 @@ TEST(EventTest, PointerDetailsCustomTouch) {
|
||||
EXPECT_EQ(0.0f, touch_event.pointer_details().tilt_x);
|
||||
EXPECT_EQ(0.0f, touch_event.pointer_details().tilt_y);
|
||||
|
||||
ui::PointerDetails pointer_details(EventPointerType::POINTER_TYPE_PEN,
|
||||
ui::PointerDetails pointer_details(EventPointerType::kPen,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 5.0f,
|
||||
/* radius_y */ 6.0f,
|
||||
@ -747,8 +747,7 @@ TEST(EventTest, PointerDetailsCustomTouch) {
|
||||
/* tangential_pressure */ 0.7f);
|
||||
touch_event.SetPointerDetailsForTest(pointer_details);
|
||||
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
touch_event.pointer_details().pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, touch_event.pointer_details().pointer_type);
|
||||
EXPECT_EQ(21.0f, touch_event.pointer_details().force);
|
||||
EXPECT_EQ(45.0f, touch_event.pointer_details().tilt_x);
|
||||
EXPECT_EQ(-45.0f, touch_event.pointer_details().tilt_y);
|
||||
|
@ -54,7 +54,7 @@ int GetChangedMouseButtonFlagsFromNative(const PlatformEvent& native_event) {
|
||||
|
||||
PointerDetails GetMousePointerDetailsFromNative(
|
||||
const PlatformEvent& native_event) {
|
||||
return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE);
|
||||
return PointerDetails(EventPointerType::kMouse);
|
||||
}
|
||||
|
||||
gfx::Vector2d GetMouseWheelOffset(const PlatformEvent& native_event) {
|
||||
@ -72,7 +72,7 @@ void ReleaseCopiedNativeEvent(const PlatformEvent& event) {}
|
||||
PointerDetails GetTouchPointerDetailsFromNative(
|
||||
const PlatformEvent& native_event) {
|
||||
NOTIMPLEMENTED();
|
||||
return PointerDetails(EventPointerType::POINTER_TYPE_UNKNOWN,
|
||||
return PointerDetails(EventPointerType::kUnknown,
|
||||
/* radius_x */ 1.0,
|
||||
/* radius_y */ 1.0,
|
||||
/* force */ 0.f,
|
||||
|
@ -133,7 +133,7 @@ bool InputEventDispatcher::ProcessTouchEvent(
|
||||
|
||||
// TODO(crbug.com/876933): Add more detailed fields such as
|
||||
// force/orientation/tilt once they are added to PointerEvent.
|
||||
ui::PointerDetails pointer_details(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
ui::PointerDetails pointer_details(ui::EventPointerType::kTouch,
|
||||
event.pointer_id);
|
||||
|
||||
ui::TouchEvent touch_event(event_type, gfx::Point(),
|
||||
|
@ -13,18 +13,18 @@ namespace {
|
||||
EventPointerType ToEventPointerType(MotionEvent::ToolType tool_type) {
|
||||
switch (tool_type) {
|
||||
case MotionEvent::ToolType::UNKNOWN:
|
||||
return EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
return EventPointerType::kUnknown;
|
||||
case MotionEvent::ToolType::FINGER:
|
||||
return EventPointerType::POINTER_TYPE_TOUCH;
|
||||
return EventPointerType::kTouch;
|
||||
case MotionEvent::ToolType::STYLUS:
|
||||
return EventPointerType::POINTER_TYPE_PEN;
|
||||
return EventPointerType::kPen;
|
||||
case MotionEvent::ToolType::MOUSE:
|
||||
return EventPointerType::POINTER_TYPE_MOUSE;
|
||||
return EventPointerType::kMouse;
|
||||
case MotionEvent::ToolType::ERASER:
|
||||
return EventPointerType::POINTER_TYPE_ERASER;
|
||||
return EventPointerType::kEraser;
|
||||
default:
|
||||
NOTREACHED() << "Invalid ToolType = " << tool_type;
|
||||
return EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
return EventPointerType::kUnknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,8 +227,7 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
|
||||
bool is_source_touch_event_set_non_blocking_ = false;
|
||||
|
||||
// The pointer type for the first touch point in the gesture.
|
||||
EventPointerType primary_pointer_type_ =
|
||||
EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
EventPointerType primary_pointer_type_ = EventPointerType::kUnknown;
|
||||
|
||||
int touch_points_; // Number of active touch points in the gesture.
|
||||
|
||||
|
@ -98,7 +98,7 @@ GestureProviderAura::GetAndResetPendingGestures() {
|
||||
void GestureProviderAura::OnTouchEnter(int pointer_id, float x, float y) {
|
||||
auto touch_event = std::make_unique<TouchEvent>(
|
||||
ET_TOUCH_PRESSED, gfx::Point(), ui::EventTimeForNow(),
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, pointer_id),
|
||||
PointerDetails(ui::EventPointerType::kTouch, pointer_id),
|
||||
EF_IS_SYNTHESIZED);
|
||||
gfx::PointF point(x, y);
|
||||
touch_event->set_location_f(point);
|
||||
|
@ -42,40 +42,35 @@ class GestureProviderAuraTest : public testing::Test,
|
||||
|
||||
TEST_F(GestureProviderAuraTest, IgnoresExtraPressEvents) {
|
||||
base::TimeTicks time = ui::EventTimeForNow();
|
||||
TouchEvent press1(
|
||||
ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent press1(ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&press1));
|
||||
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
TouchEvent press2(
|
||||
ET_TOUCH_PRESSED, gfx::Point(30, 40), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent press2(ET_TOUCH_PRESSED, gfx::Point(30, 40), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_FALSE(provider()->OnTouchEvent(&press2));
|
||||
}
|
||||
|
||||
TEST_F(GestureProviderAuraTest, IgnoresExtraMoveOrReleaseEvents) {
|
||||
base::TimeTicks time = ui::EventTimeForNow();
|
||||
TouchEvent press1(
|
||||
ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent press1(ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&press1));
|
||||
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
TouchEvent release1(
|
||||
ET_TOUCH_RELEASED, gfx::Point(30, 40), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent release1(ET_TOUCH_RELEASED, gfx::Point(30, 40), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&release1));
|
||||
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
TouchEvent release2(
|
||||
ET_TOUCH_RELEASED, gfx::Point(30, 45), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent release2(ET_TOUCH_RELEASED, gfx::Point(30, 45), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_FALSE(provider()->OnTouchEvent(&release1));
|
||||
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
TouchEvent move1(ET_TOUCH_MOVED, gfx::Point(70, 75), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_FALSE(provider()->OnTouchEvent(&move1));
|
||||
}
|
||||
|
||||
@ -83,39 +78,33 @@ TEST_F(GestureProviderAuraTest, DoesntStallOnCancelAndRelease) {
|
||||
GestureConfiguration::GetInstance()->set_single_pointer_cancel_enabled(false);
|
||||
base::TimeTicks time = ui::EventTimeForNow();
|
||||
|
||||
TouchEvent touch_press(
|
||||
ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_press(ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_press));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent pen_press1(
|
||||
ET_TOUCH_PRESSED, gfx::Point(20, 20), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_PEN, 1));
|
||||
TouchEvent pen_press1(ET_TOUCH_PRESSED, gfx::Point(20, 20), time,
|
||||
PointerDetails(ui::EventPointerType::kPen, 1));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&pen_press1));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_cancel(
|
||||
ET_TOUCH_CANCELLED, gfx::Point(30, 30), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_cancel(ET_TOUCH_CANCELLED, gfx::Point(30, 30), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_cancel));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent pen_release1(
|
||||
ET_TOUCH_RELEASED, gfx::Point(40, 40), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_PEN, 1));
|
||||
TouchEvent pen_release1(ET_TOUCH_RELEASED, gfx::Point(40, 40), time,
|
||||
PointerDetails(ui::EventPointerType::kPen, 1));
|
||||
EXPECT_FALSE(provider()->OnTouchEvent(&pen_release1));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent pen_press2(
|
||||
ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_PEN, 0));
|
||||
TouchEvent pen_press2(ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::kPen, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&pen_press2));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent pen_release2(
|
||||
ET_TOUCH_RELEASED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_PEN, 0));
|
||||
TouchEvent pen_release2(ET_TOUCH_RELEASED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::kPen, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&pen_release2));
|
||||
}
|
||||
|
||||
@ -123,45 +112,38 @@ TEST_F(GestureProviderAuraTest, ContinueGestureDetectionAfterCancel) {
|
||||
GestureConfiguration::GetInstance()->set_single_pointer_cancel_enabled(true);
|
||||
base::TimeTicks time = ui::EventTimeForNow();
|
||||
|
||||
TouchEvent touch_press1(
|
||||
ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_press1(ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_press1));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_press2(
|
||||
ET_TOUCH_PRESSED, gfx::Point(20, 20), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
TouchEvent touch_press2(ET_TOUCH_PRESSED, gfx::Point(20, 20), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_press2));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_move1(
|
||||
ET_TOUCH_MOVED, gfx::Point(30, 30), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_move1(ET_TOUCH_MOVED, gfx::Point(30, 30), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_move1));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_move2(
|
||||
ET_TOUCH_MOVED, gfx::Point(40, 40), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
TouchEvent touch_move2(ET_TOUCH_MOVED, gfx::Point(40, 40), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_move2));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_cancel(
|
||||
ET_TOUCH_CANCELLED, gfx::Point(50, 50), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
TouchEvent touch_cancel(ET_TOUCH_CANCELLED, gfx::Point(50, 50), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_cancel));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_move3(
|
||||
ET_TOUCH_MOVED, gfx::Point(60, 60), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_move3(ET_TOUCH_MOVED, gfx::Point(60, 60), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_move3));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_release(
|
||||
ET_TOUCH_RELEASED, gfx::Point(70, 70), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_release(ET_TOUCH_RELEASED, gfx::Point(70, 70), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_release));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
}
|
||||
@ -170,75 +152,63 @@ TEST_F(GestureProviderAuraTest, ContinueGestureDetectionAfterMultipleCancel) {
|
||||
GestureConfiguration::GetInstance()->set_single_pointer_cancel_enabled(true);
|
||||
base::TimeTicks time = ui::EventTimeForNow();
|
||||
|
||||
TouchEvent touch_press1(
|
||||
ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_press1(ET_TOUCH_PRESSED, gfx::Point(10, 10), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_press1));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_press2(
|
||||
ET_TOUCH_PRESSED, gfx::Point(20, 20), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
TouchEvent touch_press2(ET_TOUCH_PRESSED, gfx::Point(20, 20), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_press2));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_press3(
|
||||
ET_TOUCH_PRESSED, gfx::Point(30, 30), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
TouchEvent touch_press3(ET_TOUCH_PRESSED, gfx::Point(30, 30), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_press3));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_move1(
|
||||
ET_TOUCH_MOVED, gfx::Point(40, 40), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_move1(ET_TOUCH_MOVED, gfx::Point(40, 40), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_move1));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_move2(
|
||||
ET_TOUCH_MOVED, gfx::Point(50, 50), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
TouchEvent touch_move2(ET_TOUCH_MOVED, gfx::Point(50, 50), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_move2));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_move3(
|
||||
ET_TOUCH_MOVED, gfx::Point(60, 60), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
TouchEvent touch_move3(ET_TOUCH_MOVED, gfx::Point(60, 60), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_move3));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_cancel1(
|
||||
ET_TOUCH_CANCELLED, gfx::Point(70, 70), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
TouchEvent touch_cancel1(ET_TOUCH_CANCELLED, gfx::Point(70, 70), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_cancel1));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_move4(
|
||||
ET_TOUCH_MOVED, gfx::Point(80, 80), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_move4(ET_TOUCH_MOVED, gfx::Point(80, 80), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_move4));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_move5(
|
||||
ET_TOUCH_MOVED, gfx::Point(90, 90), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
TouchEvent touch_move5(ET_TOUCH_MOVED, gfx::Point(90, 90), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_move5));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_cancel2(
|
||||
ET_TOUCH_CANCELLED, gfx::Point(100, 100), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 2));
|
||||
TouchEvent touch_cancel2(ET_TOUCH_CANCELLED, gfx::Point(100, 100), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 2));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_cancel2));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_move6(
|
||||
ET_TOUCH_MOVED, gfx::Point(110, 110), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_move6(ET_TOUCH_MOVED, gfx::Point(110, 110), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_move6));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
|
||||
TouchEvent touch_release(
|
||||
ET_TOUCH_RELEASED, gfx::Point(120, 120), time,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
TouchEvent touch_release(ET_TOUCH_RELEASED, gfx::Point(120, 120), time,
|
||||
PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&touch_release));
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
}
|
||||
@ -251,30 +221,26 @@ TEST_F(GestureProviderAuraTest, IgnoresIdenticalMoveEvents) {
|
||||
const int kTouchId0 = 5;
|
||||
const int kTouchId1 = 3;
|
||||
|
||||
PointerDetails pointer_details1(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
kTouchId0);
|
||||
PointerDetails pointer_details1(EventPointerType::kTouch, kTouchId0);
|
||||
base::TimeTicks time = ui::EventTimeForNow();
|
||||
TouchEvent press0_1(ET_TOUCH_PRESSED, gfx::Point(9, 10), time,
|
||||
pointer_details1);
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&press0_1));
|
||||
|
||||
PointerDetails pointer_details2(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
kTouchId1);
|
||||
PointerDetails pointer_details2(EventPointerType::kTouch, kTouchId1);
|
||||
TouchEvent press1_1(ET_TOUCH_PRESSED, gfx::Point(40, 40), time,
|
||||
pointer_details2);
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&press1_1));
|
||||
|
||||
time += base::TimeDelta::FromMilliseconds(10);
|
||||
pointer_details1 =
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_TOUCH, kTouchId0, kRadiusX,
|
||||
kRadiusY, kForce, kAngle);
|
||||
pointer_details1 = PointerDetails(EventPointerType::kTouch, kTouchId0,
|
||||
kRadiusX, kRadiusY, kForce, kAngle);
|
||||
TouchEvent move0_1(ET_TOUCH_MOVED, gfx::Point(10, 10), time, pointer_details1,
|
||||
0);
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&move0_1));
|
||||
|
||||
pointer_details2 =
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_TOUCH, kTouchId1, kRadiusX,
|
||||
kRadiusY, kForce, kAngle);
|
||||
pointer_details2 = PointerDetails(EventPointerType::kTouch, kTouchId1,
|
||||
kRadiusX, kRadiusY, kForce, kAngle);
|
||||
TouchEvent move1_1(ET_TOUCH_MOVED, gfx::Point(100, 200), time,
|
||||
pointer_details2, 0);
|
||||
EXPECT_TRUE(provider()->OnTouchEvent(&move1_1));
|
||||
|
@ -230,7 +230,7 @@ GestureRecognizerImpl::GetEventPerPointForConsumer(GestureConsumer* consumer,
|
||||
for (size_t i = 0; i < pointer_state.GetPointerCount(); ++i) {
|
||||
auto touch_event = std::make_unique<TouchEvent>(
|
||||
type, gfx::Point(), EventTimeForNow(),
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
pointer_state.GetPointerId(i)),
|
||||
EF_IS_SYNTHESIZED);
|
||||
gfx::PointF point(pointer_state.GetX(i), pointer_state.GetY(i));
|
||||
|
@ -13,15 +13,15 @@ namespace {
|
||||
MotionEvent::ToolType EventPointerTypeToMotionEventToolType(
|
||||
EventPointerType type) {
|
||||
switch (type) {
|
||||
case EventPointerType::POINTER_TYPE_UNKNOWN:
|
||||
case EventPointerType::kUnknown:
|
||||
return MotionEvent::ToolType::UNKNOWN;
|
||||
case EventPointerType::POINTER_TYPE_MOUSE:
|
||||
case EventPointerType::kMouse:
|
||||
return MotionEvent::ToolType::MOUSE;
|
||||
case EventPointerType::POINTER_TYPE_PEN:
|
||||
case EventPointerType::kPen:
|
||||
return MotionEvent::ToolType::STYLUS;
|
||||
case EventPointerType::POINTER_TYPE_TOUCH:
|
||||
case EventPointerType::kTouch:
|
||||
return MotionEvent::ToolType::FINGER;
|
||||
case EventPointerType::POINTER_TYPE_ERASER:
|
||||
case EventPointerType::kEraser:
|
||||
return MotionEvent::ToolType::ERASER;
|
||||
}
|
||||
|
||||
@ -49,8 +49,8 @@ PointerProperties GetPointerPropertiesFromTouchEvent(const TouchEvent& touch) {
|
||||
if (!pointer_properties.touch_major) {
|
||||
float default_size;
|
||||
switch (touch.pointer_details().pointer_type) {
|
||||
case EventPointerType::POINTER_TYPE_PEN:
|
||||
case EventPointerType::POINTER_TYPE_ERASER:
|
||||
case EventPointerType::kPen:
|
||||
case EventPointerType::kEraser:
|
||||
// Default size for stylus events is 1x1.
|
||||
default_size = 1;
|
||||
break;
|
||||
|
@ -12,9 +12,8 @@
|
||||
namespace {
|
||||
|
||||
ui::TouchEvent TouchWithType(ui::EventType type, int id) {
|
||||
return ui::TouchEvent(
|
||||
type, gfx::Point(0, 0), base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, id));
|
||||
return ui::TouchEvent(type, gfx::Point(0, 0), base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, id));
|
||||
}
|
||||
|
||||
ui::TouchEvent TouchWithPosition(ui::EventType type,
|
||||
@ -23,9 +22,8 @@ ui::TouchEvent TouchWithPosition(ui::EventType type,
|
||||
float y,
|
||||
float raw_x,
|
||||
float raw_y) {
|
||||
ui::TouchEvent event(
|
||||
type, gfx::Point(), base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, id));
|
||||
ui::TouchEvent event(type, gfx::Point(), base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, id));
|
||||
event.set_location_f(gfx::PointF(x, y));
|
||||
event.set_root_location_f(gfx::PointF(raw_x, raw_y));
|
||||
return event;
|
||||
@ -39,8 +37,8 @@ ui::TouchEvent TouchWithTapParams(ui::EventType type,
|
||||
float pressure) {
|
||||
ui::TouchEvent event(
|
||||
type, gfx::Point(1, 1), base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, id, radius_x,
|
||||
radius_y, pressure, rotation_angle),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, id, radius_x, radius_y,
|
||||
pressure, rotation_angle),
|
||||
0);
|
||||
return event;
|
||||
}
|
||||
@ -50,9 +48,8 @@ base::TimeTicks MsToTicks(int ms) {
|
||||
}
|
||||
|
||||
ui::TouchEvent TouchWithTime(ui::EventType type, int id, int ms) {
|
||||
return ui::TouchEvent(
|
||||
type, gfx::Point(0, 0), MsToTicks(ms),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, id));
|
||||
return ui::TouchEvent(type, gfx::Point(0, 0), MsToTicks(ms),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, id));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@ -434,7 +431,7 @@ TEST(MotionEventAuraTest, ToolType) {
|
||||
EXPECT_EQ(MotionEvent::ToolType::FINGER, event.GetToolType(0));
|
||||
|
||||
touch_event = TouchWithType(ET_TOUCH_RELEASED, 7);
|
||||
PointerDetails pointer_details(EventPointerType::POINTER_TYPE_PEN,
|
||||
PointerDetails pointer_details(EventPointerType::kPen,
|
||||
/* pointer_id*/ 7,
|
||||
/* radius_x */ 5.0f,
|
||||
/* radius_y */ 5.0f,
|
||||
@ -539,9 +536,9 @@ TEST(MotionEventAuraTest, IgnoresTouchesOverCapacity) {
|
||||
|
||||
TEST(MotionEventAuraTest, PenRadiusDefault) {
|
||||
MotionEventAura event;
|
||||
TouchEvent touch_event = ui::TouchEvent(
|
||||
ET_TOUCH_PRESSED, gfx::Point(0, 0), base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_PEN, 7));
|
||||
TouchEvent touch_event =
|
||||
ui::TouchEvent(ET_TOUCH_PRESSED, gfx::Point(0, 0), base::TimeTicks(),
|
||||
ui::PointerDetails(ui::EventPointerType::kPen, 7));
|
||||
EXPECT_TRUE(event.OnTouch(touch_event));
|
||||
EXPECT_EQ(MotionEvent::ToolType::STYLUS, event.GetToolType(0));
|
||||
EXPECT_EQ(1u, event.GetTouchMajor(0));
|
||||
|
@ -104,15 +104,15 @@ template <>
|
||||
struct EnumTraits<ui::mojom::PointerKind, ui::EventPointerType> {
|
||||
static ui::mojom::PointerKind ToMojom(ui::EventPointerType input) {
|
||||
switch (input) {
|
||||
case ui::EventPointerType::POINTER_TYPE_UNKNOWN:
|
||||
case ui::EventPointerType::kUnknown:
|
||||
return ui::mojom::PointerKind::UNKNOWN;
|
||||
case ui::EventPointerType::POINTER_TYPE_MOUSE:
|
||||
case ui::EventPointerType::kMouse:
|
||||
return ui::mojom::PointerKind::MOUSE;
|
||||
case ui::EventPointerType::POINTER_TYPE_PEN:
|
||||
case ui::EventPointerType::kPen:
|
||||
return ui::mojom::PointerKind::PEN;
|
||||
case ui::EventPointerType::POINTER_TYPE_TOUCH:
|
||||
case ui::EventPointerType::kTouch:
|
||||
return ui::mojom::PointerKind::TOUCH;
|
||||
case ui::EventPointerType::POINTER_TYPE_ERASER:
|
||||
case ui::EventPointerType::kEraser:
|
||||
return ui::mojom::PointerKind::ERASER;
|
||||
}
|
||||
NOTREACHED();
|
||||
@ -123,19 +123,19 @@ struct EnumTraits<ui::mojom::PointerKind, ui::EventPointerType> {
|
||||
ui::EventPointerType* out) {
|
||||
switch (input) {
|
||||
case ui::mojom::PointerKind::UNKNOWN:
|
||||
*out = ui::EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
*out = ui::EventPointerType::kUnknown;
|
||||
return true;
|
||||
case ui::mojom::PointerKind::MOUSE:
|
||||
*out = ui::EventPointerType::POINTER_TYPE_MOUSE;
|
||||
*out = ui::EventPointerType::kMouse;
|
||||
return true;
|
||||
case ui::mojom::PointerKind::PEN:
|
||||
*out = ui::EventPointerType::POINTER_TYPE_PEN;
|
||||
*out = ui::EventPointerType::kPen;
|
||||
return true;
|
||||
case ui::mojom::PointerKind::TOUCH:
|
||||
*out = ui::EventPointerType::POINTER_TYPE_TOUCH;
|
||||
*out = ui::EventPointerType::kTouch;
|
||||
return true;
|
||||
case ui::mojom::PointerKind::ERASER:
|
||||
*out = ui::EventPointerType::POINTER_TYPE_ERASER;
|
||||
*out = ui::EventPointerType::kEraser;
|
||||
return true;
|
||||
}
|
||||
NOTREACHED();
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "mojo/public/cpp/test_support/test_utils.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "ui/events/event.h"
|
||||
#include "ui/events/ipc/ui_events_param_traits_macros.h"
|
||||
#include "ui/events/keycodes/dom/dom_code.h"
|
||||
#include "ui/events/mojom/event.mojom.h"
|
||||
#include "ui/events/mojom/event_mojom_traits.h"
|
||||
@ -125,30 +126,29 @@ TEST(StructTraitsTest, MouseEvent) {
|
||||
const MouseEvent kTestData[] = {
|
||||
{ET_MOUSE_PRESSED, gfx::Point(10, 10), gfx::Point(20, 30),
|
||||
base::TimeTicks() + base::TimeDelta::FromMicroseconds(201), EF_NONE, 0,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, kPointerIdMouse)},
|
||||
PointerDetails(EventPointerType::kMouse, kPointerIdMouse)},
|
||||
{ET_MOUSE_DRAGGED, gfx::Point(1, 5), gfx::Point(5, 1),
|
||||
base::TimeTicks() + base::TimeDelta::FromMicroseconds(202),
|
||||
EF_LEFT_MOUSE_BUTTON, EF_LEFT_MOUSE_BUTTON,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, kPointerIdMouse)},
|
||||
PointerDetails(EventPointerType::kMouse, kPointerIdMouse)},
|
||||
{ET_MOUSE_RELEASED, gfx::Point(411, 130), gfx::Point(20, 30),
|
||||
base::TimeTicks() + base::TimeDelta::FromMicroseconds(203),
|
||||
EF_MIDDLE_MOUSE_BUTTON | EF_RIGHT_MOUSE_BUTTON, EF_RIGHT_MOUSE_BUTTON,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, kPointerIdMouse)},
|
||||
PointerDetails(EventPointerType::kMouse, kPointerIdMouse)},
|
||||
{ET_MOUSE_MOVED, gfx::Point(0, 1), gfx::Point(2, 3),
|
||||
base::TimeTicks() + base::TimeDelta::FromMicroseconds(204), EF_ALT_DOWN,
|
||||
0,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, kPointerIdMouse)},
|
||||
0, PointerDetails(EventPointerType::kMouse, kPointerIdMouse)},
|
||||
{ET_MOUSE_ENTERED, gfx::Point(6, 7), gfx::Point(8, 9),
|
||||
base::TimeTicks() + base::TimeDelta::FromMicroseconds(205), EF_NONE, 0,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, kPointerIdMouse)},
|
||||
PointerDetails(EventPointerType::kMouse, kPointerIdMouse)},
|
||||
{ET_MOUSE_EXITED, gfx::Point(10, 10), gfx::Point(20, 30),
|
||||
base::TimeTicks() + base::TimeDelta::FromMicroseconds(206),
|
||||
EF_BACK_MOUSE_BUTTON, 0,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, kPointerIdMouse)},
|
||||
PointerDetails(EventPointerType::kMouse, kPointerIdMouse)},
|
||||
{ET_MOUSE_CAPTURE_CHANGED, gfx::Point(99, 99), gfx::Point(99, 99),
|
||||
base::TimeTicks() + base::TimeDelta::FromMicroseconds(207),
|
||||
EF_CONTROL_DOWN, 0,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, kPointerIdMouse)},
|
||||
PointerDetails(EventPointerType::kMouse, kPointerIdMouse)},
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < base::size(kTestData); i++) {
|
||||
@ -332,13 +332,11 @@ TEST(StructTraitsTest, ScrollEvent) {
|
||||
|
||||
TEST(StructTraitsTest, PointerDetails) {
|
||||
const PointerDetails kTestData[] = {
|
||||
{EventPointerType::POINTER_TYPE_UNKNOWN, 1, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f},
|
||||
{EventPointerType::POINTER_TYPE_MOUSE, 1, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f},
|
||||
{EventPointerType::POINTER_TYPE_PEN, 11, 12.f, 13.f, 14.f, 15.f, 16.f,
|
||||
17.f},
|
||||
{EventPointerType::POINTER_TYPE_TOUCH, 1, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f},
|
||||
{EventPointerType::POINTER_TYPE_ERASER, 21, 22.f, 23.f, 24.f, 25.f, 26.f,
|
||||
27.f},
|
||||
{EventPointerType::kUnknown, 1, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f},
|
||||
{EventPointerType::kMouse, 1, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f},
|
||||
{EventPointerType::kPen, 11, 12.f, 13.f, 14.f, 15.f, 16.f, 17.f},
|
||||
{EventPointerType::kTouch, 1, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f},
|
||||
{EventPointerType::kEraser, 21, 22.f, 23.f, 24.f, 25.f, 26.f, 27.f},
|
||||
};
|
||||
for (size_t i = 0; i < base::size(kTestData); i++) {
|
||||
// Set |offset| as the constructor used above does not modify it.
|
||||
@ -358,8 +356,7 @@ TEST(StructTraitsTest, TouchEvent) {
|
||||
{ET_TOUCH_RELEASED,
|
||||
{1, 2},
|
||||
base::TimeTicks::Now(),
|
||||
{EventPointerType::POINTER_TYPE_UNKNOWN, 1, 2.f, 3.f, 4.f, 5.f, 6.f,
|
||||
7.f},
|
||||
{EventPointerType::kUnknown, 1, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f},
|
||||
EF_SHIFT_DOWN},
|
||||
{ET_TOUCH_PRESSED, {1, 2}, base::TimeTicks::Now(), {}, EF_CONTROL_DOWN},
|
||||
{ET_TOUCH_MOVED, {1, 2}, base::TimeTicks::Now(), {}, EF_NONE},
|
||||
|
@ -239,8 +239,8 @@ void EventConverterEvdevImpl::OnButtonChange(int code,
|
||||
|
||||
dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams(
|
||||
input_device_.id, EF_NONE, cursor_->GetLocation(), code, down,
|
||||
/* allow_remap */ true,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), timestamp));
|
||||
/* allow_remap */ true, PointerDetails(EventPointerType::kMouse),
|
||||
timestamp));
|
||||
}
|
||||
|
||||
void EventConverterEvdevImpl::FlushEvents(const input_event& input) {
|
||||
@ -251,7 +251,7 @@ void EventConverterEvdevImpl::FlushEvents(const input_event& input) {
|
||||
|
||||
dispatcher_->DispatchMouseMoveEvent(
|
||||
MouseMoveEventParams(input_device_.id, EF_NONE, cursor_->GetLocation(),
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE),
|
||||
PointerDetails(EventPointerType::kMouse),
|
||||
TimeTicksFromInputEvent(input)));
|
||||
|
||||
x_offset_ = 0;
|
||||
|
@ -465,12 +465,12 @@ void EventFactoryEvdev::WarpCursorTo(gfx::AcceleratedWidget widget,
|
||||
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&EventFactoryEvdev::DispatchMouseMoveEvent,
|
||||
weak_ptr_factory_.GetWeakPtr(),
|
||||
MouseMoveEventParams(
|
||||
-1 /* device_id */, EF_NONE, cursor_->GetLocation(),
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE),
|
||||
EventTimeForNow())));
|
||||
base::BindOnce(
|
||||
&EventFactoryEvdev::DispatchMouseMoveEvent,
|
||||
weak_ptr_factory_.GetWeakPtr(),
|
||||
MouseMoveEventParams(
|
||||
-1 /* device_id */, EF_NONE, cursor_->GetLocation(),
|
||||
PointerDetails(EventPointerType::kMouse), EventTimeForNow())));
|
||||
}
|
||||
|
||||
int EventFactoryEvdev::NextDeviceId() {
|
||||
|
@ -50,8 +50,8 @@ void InputInjectorEvdev::InjectMouseButton(EventFlags button, bool down) {
|
||||
|
||||
dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams(
|
||||
kDeviceIdForInjection, EF_NONE, cursor_->GetLocation(), code, down,
|
||||
false /* allow_remap */,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), EventTimeForNow()));
|
||||
false /* allow_remap */, PointerDetails(EventPointerType::kMouse),
|
||||
EventTimeForNow()));
|
||||
}
|
||||
|
||||
void InputInjectorEvdev::InjectMouseWheel(int delta_x, int delta_y) {
|
||||
@ -68,7 +68,7 @@ void InputInjectorEvdev::MoveCursorTo(const gfx::PointF& location) {
|
||||
|
||||
dispatcher_->DispatchMouseMoveEvent(MouseMoveEventParams(
|
||||
kDeviceIdForInjection, EF_NONE, cursor_->GetLocation(),
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), EventTimeForNow()));
|
||||
PointerDetails(EventPointerType::kMouse), EventTimeForNow()));
|
||||
}
|
||||
|
||||
void InputInjectorEvdev::InjectKeyEvent(DomCode physical_key,
|
||||
|
@ -295,7 +295,7 @@ void GestureInterpreterLibevdevCros::OnGestureMove(const Gesture* gesture,
|
||||
// TODO(spang): Use move->ordinal_dx, move->ordinal_dy
|
||||
dispatcher_->DispatchMouseMoveEvent(
|
||||
MouseMoveEventParams(id_, EF_NONE, cursor_->GetLocation(),
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE),
|
||||
PointerDetails(EventPointerType::kMouse),
|
||||
StimeToTimeTicks(gesture->end_time)));
|
||||
}
|
||||
|
||||
@ -500,8 +500,7 @@ void GestureInterpreterLibevdevCros::DispatchMouseButton(unsigned int button,
|
||||
bool allow_remap = is_mouse_;
|
||||
dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams(
|
||||
id_, EF_NONE, cursor_->GetLocation(), button, down, allow_remap,
|
||||
PointerDetails(EventPointerType::POINTER_TYPE_MOUSE),
|
||||
StimeToTimeTicks(time)));
|
||||
PointerDetails(EventPointerType::kMouse), StimeToTimeTicks(time)));
|
||||
}
|
||||
|
||||
void GestureInterpreterLibevdevCros::DispatchChangedKeys(
|
||||
|
@ -23,8 +23,8 @@ float ScaleTilt(int value, int min_value, int num_values) {
|
||||
|
||||
EventPointerType GetToolType(int button_tool) {
|
||||
if (button_tool == BTN_TOOL_RUBBER)
|
||||
return EventPointerType::POINTER_TYPE_ERASER;
|
||||
return EventPointerType::POINTER_TYPE_PEN;
|
||||
return EventPointerType::kEraser;
|
||||
return EventPointerType::kPen;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -458,19 +458,16 @@ TEST_F(TabletEventConverterEvdevTest, Tap) {
|
||||
|
||||
ui::MouseEvent* event = dispatched_event(0);
|
||||
EXPECT_EQ(ui::ET_MOUSE_MOVED, event->type());
|
||||
EXPECT_EQ(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
event->pointer_details().pointer_type);
|
||||
EXPECT_EQ(ui::EventPointerType::kPen, event->pointer_details().pointer_type);
|
||||
EXPECT_FLOAT_EQ(5.625f, event->pointer_details().tilt_x);
|
||||
EXPECT_FLOAT_EQ(0.f, event->pointer_details().tilt_y);
|
||||
event = dispatched_event(1);
|
||||
EXPECT_EQ(ui::ET_MOUSE_PRESSED, event->type());
|
||||
EXPECT_EQ(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
event->pointer_details().pointer_type);
|
||||
EXPECT_EQ(ui::EventPointerType::kPen, event->pointer_details().pointer_type);
|
||||
EXPECT_FLOAT_EQ((float)992 / 2047, event->pointer_details().force);
|
||||
EXPECT_EQ(true, event->IsLeftMouseButton());
|
||||
event = dispatched_event(2);
|
||||
EXPECT_EQ(ui::EventPointerType::POINTER_TYPE_PEN,
|
||||
event->pointer_details().pointer_type);
|
||||
EXPECT_EQ(ui::EventPointerType::kPen, event->pointer_details().pointer_type);
|
||||
EXPECT_EQ(ui::ET_MOUSE_RELEASED, event->type());
|
||||
EXPECT_FLOAT_EQ(0.0f, event->pointer_details().force);
|
||||
EXPECT_EQ(true, event->IsLeftMouseButton());
|
||||
|
@ -65,8 +65,7 @@ struct COMPONENT_EXPORT(EVDEV) InProgressTouchEvdev {
|
||||
int tool_code = 0;
|
||||
float tilt_x = 0;
|
||||
float tilt_y = 0;
|
||||
ui::EventPointerType reported_tool_type =
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH;
|
||||
ui::EventPointerType reported_tool_type = ui::EventPointerType::kTouch;
|
||||
bool stylus_button = false;
|
||||
};
|
||||
|
||||
|
@ -68,11 +68,11 @@ int32_t AbsCodeToMtCode(int32_t code) {
|
||||
ui::EventPointerType GetEventPointerType(int tool_code) {
|
||||
switch (tool_code) {
|
||||
case BTN_TOOL_PEN:
|
||||
return ui::EventPointerType::POINTER_TYPE_PEN;
|
||||
return ui::EventPointerType::kPen;
|
||||
case BTN_TOOL_RUBBER:
|
||||
return ui::EventPointerType::POINTER_TYPE_ERASER;
|
||||
return ui::EventPointerType::kEraser;
|
||||
default:
|
||||
return ui::EventPointerType::POINTER_TYPE_TOUCH;
|
||||
return ui::EventPointerType::kTouch;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -391,8 +391,7 @@ TEST_F(TouchEventConverterEvdevTest, TouchMove) {
|
||||
EXPECT_EQ(295, event.location.x());
|
||||
EXPECT_EQ(421, event.location.y());
|
||||
EXPECT_EQ(0, event.slot);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kTouch, event.pointer_details.pointer_type);
|
||||
EXPECT_FLOAT_EQ(58.f, event.pointer_details.radius_x);
|
||||
EXPECT_FLOAT_EQ(0.13333334f, event.pointer_details.force);
|
||||
|
||||
@ -407,8 +406,7 @@ TEST_F(TouchEventConverterEvdevTest, TouchMove) {
|
||||
EXPECT_EQ(312, event.location.x());
|
||||
EXPECT_EQ(432, event.location.y());
|
||||
EXPECT_EQ(0, event.slot);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kTouch, event.pointer_details.pointer_type);
|
||||
EXPECT_FLOAT_EQ(50.f, event.pointer_details.radius_x);
|
||||
EXPECT_FLOAT_EQ(0.16862745f, event.pointer_details.force);
|
||||
|
||||
@ -423,8 +421,7 @@ TEST_F(TouchEventConverterEvdevTest, TouchMove) {
|
||||
EXPECT_EQ(312, event.location.x());
|
||||
EXPECT_EQ(432, event.location.y());
|
||||
EXPECT_EQ(0, event.slot);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kTouch, event.pointer_details.pointer_type);
|
||||
EXPECT_FLOAT_EQ(50.f, event.pointer_details.radius_x);
|
||||
EXPECT_FLOAT_EQ(0.16862745f, event.pointer_details.force);
|
||||
}
|
||||
@ -1725,16 +1722,14 @@ TEST_F(TouchEventConverterEvdevTest, ActiveStylusTouchAndRelease) {
|
||||
EXPECT_EQ(ET_TOUCH_PRESSED, down_event.type);
|
||||
EXPECT_EQ(9170, down_event.location.x());
|
||||
EXPECT_EQ(3658, down_event.location.y());
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
down_event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, down_event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(60.f / 1024, down_event.pointer_details.force);
|
||||
|
||||
auto up_event = dispatched_touch_event(1);
|
||||
EXPECT_EQ(ET_TOUCH_RELEASED, up_event.type);
|
||||
EXPECT_EQ(9173, up_event.location.x());
|
||||
EXPECT_EQ(3906, up_event.location.y());
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
up_event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, up_event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(0.f, up_event.pointer_details.force);
|
||||
}
|
||||
|
||||
@ -1775,32 +1770,28 @@ TEST_F(TouchEventConverterEvdevTest, ActiveStylusMotion) {
|
||||
EXPECT_EQ(ET_TOUCH_PRESSED, event.type);
|
||||
EXPECT_EQ(8921, event.location.x());
|
||||
EXPECT_EQ(1072, event.location.y());
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(35.f / 1024, event.pointer_details.force);
|
||||
|
||||
event = dispatched_touch_event(1);
|
||||
EXPECT_EQ(ET_TOUCH_MOVED, event.type);
|
||||
EXPECT_EQ(8934, event.location.x());
|
||||
EXPECT_EQ(981, event.location.y());
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(184.f / 1024, event.pointer_details.force);
|
||||
|
||||
event = dispatched_touch_event(2);
|
||||
EXPECT_EQ(ET_TOUCH_MOVED, event.type);
|
||||
EXPECT_EQ(8930, event.location.x());
|
||||
EXPECT_EQ(980, event.location.y());
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(348.f / 1024, event.pointer_details.force);
|
||||
|
||||
event = dispatched_touch_event(3);
|
||||
EXPECT_EQ(ET_TOUCH_RELEASED, event.type);
|
||||
EXPECT_EQ(8930, event.location.x());
|
||||
EXPECT_EQ(980, event.location.y());
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(0.f / 1024, event.pointer_details.force);
|
||||
}
|
||||
|
||||
@ -1834,23 +1825,19 @@ TEST_F(TouchEventConverterEvdevTest, ActiveStylusDrallionRubberSequence) {
|
||||
|
||||
ui::TouchEventParams event = dispatched_touch_event(0);
|
||||
EXPECT_EQ(ET_TOUCH_PRESSED, event.type);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_ERASER,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kEraser, event.pointer_details.pointer_type);
|
||||
|
||||
event = dispatched_touch_event(1);
|
||||
EXPECT_EQ(ET_TOUCH_MOVED, event.type);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_ERASER,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kEraser, event.pointer_details.pointer_type);
|
||||
|
||||
event = dispatched_touch_event(2);
|
||||
EXPECT_EQ(ET_TOUCH_MOVED, event.type);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_ERASER,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kEraser, event.pointer_details.pointer_type);
|
||||
|
||||
event = dispatched_touch_event(3);
|
||||
EXPECT_EQ(ET_TOUCH_RELEASED, event.type);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_ERASER,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kEraser, event.pointer_details.pointer_type);
|
||||
}
|
||||
|
||||
TEST_F(TouchEventConverterEvdevTest, ActiveStylusBarrelButtonWhileHovering) {
|
||||
@ -1892,14 +1879,12 @@ TEST_F(TouchEventConverterEvdevTest, ActiveStylusBarrelButtonWhileHovering) {
|
||||
auto down_event = dispatched_touch_event(0);
|
||||
EXPECT_EQ(ET_TOUCH_PRESSED, down_event.type);
|
||||
EXPECT_TRUE(down_event.flags & ui::EventFlags::EF_LEFT_MOUSE_BUTTON);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
down_event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, down_event.pointer_details.pointer_type);
|
||||
|
||||
auto up_event = dispatched_touch_event(1);
|
||||
EXPECT_EQ(ET_TOUCH_RELEASED, up_event.type);
|
||||
EXPECT_TRUE(down_event.flags & ui::EventFlags::EF_LEFT_MOUSE_BUTTON);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
up_event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, up_event.pointer_details.pointer_type);
|
||||
}
|
||||
|
||||
TEST_F(TouchEventConverterEvdevTest, ActiveStylusBarrelButton) {
|
||||
@ -1941,26 +1926,24 @@ TEST_F(TouchEventConverterEvdevTest, ActiveStylusBarrelButton) {
|
||||
auto down_event = dispatched_touch_event(0);
|
||||
EXPECT_EQ(ET_TOUCH_PRESSED, down_event.type);
|
||||
EXPECT_FALSE(down_event.flags & ui::EventFlags::EF_LEFT_MOUSE_BUTTON);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
down_event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, down_event.pointer_details.pointer_type);
|
||||
|
||||
auto button_down_event = dispatched_touch_event(1);
|
||||
EXPECT_EQ(ET_TOUCH_MOVED, button_down_event.type);
|
||||
EXPECT_TRUE(button_down_event.flags & ui::EventFlags::EF_LEFT_MOUSE_BUTTON);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
EXPECT_EQ(EventPointerType::kPen,
|
||||
button_down_event.pointer_details.pointer_type);
|
||||
|
||||
auto button_up_event = dispatched_touch_event(2);
|
||||
EXPECT_EQ(ET_TOUCH_MOVED, button_up_event.type);
|
||||
EXPECT_FALSE(button_up_event.flags & ui::EventFlags::EF_LEFT_MOUSE_BUTTON);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
EXPECT_EQ(EventPointerType::kPen,
|
||||
button_up_event.pointer_details.pointer_type);
|
||||
|
||||
auto up_event = dispatched_touch_event(3);
|
||||
EXPECT_EQ(ET_TOUCH_RELEASED, up_event.type);
|
||||
EXPECT_FALSE(down_event.flags & ui::EventFlags::EF_LEFT_MOUSE_BUTTON);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
|
||||
up_event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kPen, up_event.pointer_details.pointer_type);
|
||||
}
|
||||
|
||||
TEST_F(TouchEventConverterEvdevTest, HeldEventNotSent) {
|
||||
@ -2300,8 +2283,7 @@ TEST_F(TouchEventConverterEvdevTest, FingerSizeWithResolution) {
|
||||
EXPECT_EQ(0, event.slot);
|
||||
EXPECT_FLOAT_EQ(217.0 / devinfo.GetAbsMaximum(ABS_MT_PRESSURE),
|
||||
event.pointer_details.force);
|
||||
EXPECT_EQ(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
event.pointer_details.pointer_type);
|
||||
EXPECT_EQ(EventPointerType::kTouch, event.pointer_details.pointer_type);
|
||||
EXPECT_FLOAT_EQ(280.f, event.pointer_details.radius_x);
|
||||
EXPECT_FLOAT_EQ(220.f, event.pointer_details.radius_y);
|
||||
const ui::InProgressTouchEvdev& in_progress_event = dev->event(0);
|
||||
|
@ -39,9 +39,7 @@ PointerDetails::PointerDetails(EventPointerType pointer_type,
|
||||
twist(twist),
|
||||
id(pointer_id) {
|
||||
if (pointer_id == kPointerIdUnknown) {
|
||||
id = (pointer_type == EventPointerType::POINTER_TYPE_MOUSE)
|
||||
? kPointerIdMouse
|
||||
: 0;
|
||||
id = (pointer_type == EventPointerType::kMouse) ? kPointerIdMouse : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ struct EVENTS_BASE_EXPORT PointerDetails {
|
||||
bool operator==(const PointerDetails& other) const;
|
||||
|
||||
// The type of pointer device.
|
||||
EventPointerType pointer_type = EventPointerType::POINTER_TYPE_UNKNOWN;
|
||||
EventPointerType pointer_type = EventPointerType::kUnknown;
|
||||
|
||||
// Radius of the X (major) axis of the touch ellipse. 0.0 if unknown.
|
||||
float radius_x = 0.0;
|
||||
|
@ -69,7 +69,7 @@ class TestTouchEvent : public ui::TouchEvent {
|
||||
: TouchEvent(type,
|
||||
root_location,
|
||||
timestamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ touch_id,
|
||||
/* radius_x */ 1.0f,
|
||||
/* radius_y */ 1.0f,
|
||||
@ -242,12 +242,11 @@ void EventGenerator::MoveMouseToCenterOf(EventTarget* window) {
|
||||
}
|
||||
|
||||
void EventGenerator::EnterPenPointerMode() {
|
||||
touch_pointer_details_.pointer_type = ui::EventPointerType::POINTER_TYPE_PEN;
|
||||
touch_pointer_details_.pointer_type = ui::EventPointerType::kPen;
|
||||
}
|
||||
|
||||
void EventGenerator::ExitPenPointerMode() {
|
||||
touch_pointer_details_.pointer_type =
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH;
|
||||
touch_pointer_details_.pointer_type = ui::EventPointerType::kTouch;
|
||||
}
|
||||
|
||||
void EventGenerator::SetTouchRadius(float x, float y) {
|
||||
@ -312,13 +311,13 @@ void EventGenerator::GestureTapAt(const gfx::Point& location) {
|
||||
const int kTouchId = 2;
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, converted_location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, kTouchId));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, kTouchId));
|
||||
Dispatch(&press);
|
||||
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, converted_location,
|
||||
press.time_stamp() + base::TimeDelta::FromMilliseconds(50),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, kTouchId));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, kTouchId));
|
||||
Dispatch(&release);
|
||||
}
|
||||
|
||||
@ -330,13 +329,13 @@ void EventGenerator::GestureTapDownAndUp(const gfx::Point& location) {
|
||||
const int kTouchId = 3;
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, converted_location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, kTouchId));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, kTouchId));
|
||||
Dispatch(&press);
|
||||
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, converted_location,
|
||||
press.time_stamp() + base::TimeDelta::FromMilliseconds(1000),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, kTouchId));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, kTouchId));
|
||||
Dispatch(&release);
|
||||
}
|
||||
|
||||
@ -368,7 +367,7 @@ void EventGenerator::GestureScrollSequenceWithCallback(
|
||||
const int kTouchId = 5;
|
||||
base::TimeTicks timestamp = ui::EventTimeForNow();
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, start, timestamp,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ kTouchId,
|
||||
/* radius_x */ 5.0f,
|
||||
/* radius_y */ 5.0f,
|
||||
@ -384,7 +383,7 @@ void EventGenerator::GestureScrollSequenceWithCallback(
|
||||
location.Offset(dx, dy);
|
||||
timestamp += step_delay;
|
||||
ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(), timestamp,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ kTouchId,
|
||||
/* radius_x */ 5.0f,
|
||||
/* radius_y */ 5.0f,
|
||||
@ -395,13 +394,12 @@ void EventGenerator::GestureScrollSequenceWithCallback(
|
||||
callback.Run(ui::ET_GESTURE_SCROLL_UPDATE, gfx::Vector2dF(dx, dy));
|
||||
}
|
||||
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, end, timestamp,
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
/* pointer_id*/ kTouchId,
|
||||
/* radius_x */ 5.0f,
|
||||
/* radius_y */ 5.0f,
|
||||
/* force */ 1.0f));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, end, timestamp,
|
||||
PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ kTouchId,
|
||||
/* radius_x */ 5.0f,
|
||||
/* radius_y */ 5.0f,
|
||||
/* force */ 1.0f));
|
||||
Dispatch(&release);
|
||||
|
||||
callback.Run(ui::ET_GESTURE_SCROLL_END, gfx::Vector2dF());
|
||||
@ -449,7 +447,7 @@ void EventGenerator::GestureMultiFingerScrollWithDelays(
|
||||
if (!pressed[i] && move_time >= press_time[i]) {
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, points[i], press_time[i],
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, i));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, i));
|
||||
Dispatch(&press);
|
||||
pressed[i] = true;
|
||||
}
|
||||
@ -461,7 +459,7 @@ void EventGenerator::GestureMultiFingerScrollWithDelays(
|
||||
if (pressed[i] && move_time >= release_time[i]) {
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, points[i], release_time[i],
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, i));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, i));
|
||||
Dispatch(&release);
|
||||
pressed[i] = false;
|
||||
}
|
||||
@ -472,7 +470,7 @@ void EventGenerator::GestureMultiFingerScrollWithDelays(
|
||||
if (pressed[i]) {
|
||||
ui::TouchEvent move(
|
||||
ui::ET_TOUCH_MOVED, points[i], move_time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, i));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, i));
|
||||
Dispatch(&move);
|
||||
}
|
||||
}
|
||||
@ -486,7 +484,7 @@ void EventGenerator::GestureMultiFingerScrollWithDelays(
|
||||
if (pressed[i]) {
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, points[i], default_release_time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, i));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, i));
|
||||
Dispatch(&release);
|
||||
pressed[i] = false;
|
||||
}
|
||||
@ -622,12 +620,11 @@ void EventGenerator::Init(gfx::NativeWindow root_window,
|
||||
else if (root_window)
|
||||
delegate()->ConvertPointFromWindow(root_window, ¤t_screen_location_);
|
||||
current_target_ = delegate()->GetTargetAt(current_screen_location_);
|
||||
touch_pointer_details_ =
|
||||
PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 1.0f,
|
||||
/* radius_y */ 1.0f,
|
||||
/* force */ 0.0f);
|
||||
touch_pointer_details_ = PointerDetails(ui::EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 1.0f,
|
||||
/* radius_y */ 1.0f,
|
||||
/* force */ 0.0f);
|
||||
}
|
||||
|
||||
void EventGenerator::DispatchKeyEvent(bool is_press,
|
||||
|
@ -249,7 +249,7 @@ class EventGenerator {
|
||||
void MoveMouseToCenterOf(EventTarget* window);
|
||||
|
||||
// Enter pen-pointer mode, which will cause any generated mouse events to have
|
||||
// a pointer type ui::EventPointerType::POINTER_TYPE_PEN.
|
||||
// a pointer type ui::EventPointerType::kPen.
|
||||
void EnterPenPointerMode();
|
||||
|
||||
// Exit pen-pointer mode. Generated mouse events will use the default pointer
|
||||
|
@ -60,7 +60,7 @@ void ReleaseCopiedNativeEvent(const MSG& event) {}
|
||||
|
||||
PointerDetails GetTouchPointerDetailsFromNative(const MSG& native_event) {
|
||||
NOTIMPLEMENTED();
|
||||
return PointerDetails(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
return PointerDetails(EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 1.0,
|
||||
/* radius_y */ 1.0,
|
||||
|
@ -322,9 +322,9 @@ PointerDetails GetMousePointerDetailsFromMSG(const MSG& native_event) {
|
||||
// We should filter out all the mouse events Synthesized from touch events.
|
||||
// TODO(lanwei): Will set the pointer ID, see https://crbug.com/616771.
|
||||
if ((GetMessageExtraInfo() & SIGNATURE_MASK) != MOUSEEVENTF_FROMTOUCHPEN)
|
||||
return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE);
|
||||
return PointerDetails(EventPointerType::kMouse);
|
||||
|
||||
return PointerDetails(EventPointerType::POINTER_TYPE_PEN);
|
||||
return PointerDetails(EventPointerType::kPen);
|
||||
}
|
||||
|
||||
gfx::Vector2d GetMouseWheelOffsetFromMSG(const MSG& native_event) {
|
||||
@ -352,7 +352,7 @@ int GetTouchIdFromMSG(const MSG& xev) {
|
||||
|
||||
PointerDetails GetTouchPointerDetailsFromMSG(const MSG& native_event) {
|
||||
NOTIMPLEMENTED();
|
||||
return PointerDetails(EventPointerType::POINTER_TYPE_TOUCH,
|
||||
return PointerDetails(EventPointerType::kTouch,
|
||||
/* pointer_id*/ 0,
|
||||
/* radius_x */ 1.0,
|
||||
/* radius_y */ 1.0,
|
||||
|
@ -739,7 +739,7 @@ EventPointerType GetTouchPointerTypeFromXEvent(const XEvent& xev) {
|
||||
|
||||
PointerDetails GetTouchPointerDetailsFromXEvent(const XEvent& xev) {
|
||||
return PointerDetails(
|
||||
EventPointerType::POINTER_TYPE_TOUCH, GetTouchIdFromXEvent(xev),
|
||||
EventPointerType::kTouch, GetTouchIdFromXEvent(xev),
|
||||
GetTouchRadiusXFromXEvent(xev), GetTouchRadiusYFromXEvent(xev),
|
||||
GetTouchForceFromXEvent(xev), GetTouchAngleFromXEvent(xev));
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ std::unique_ptr<MouseEvent> CreateMouseEvent(EventType type,
|
||||
if (enter_or_leave && xev.xcrossing.detail == NotifyInferior)
|
||||
return nullptr;
|
||||
|
||||
PointerDetails details{EventPointerType::POINTER_TYPE_MOUSE};
|
||||
PointerDetails details{EventPointerType::kMouse};
|
||||
auto event = std::make_unique<MouseEvent>(
|
||||
type, EventLocationFromXEvent(xev), EventSystemLocationFromXEvent(xev),
|
||||
EventTimeFromXEvent(xev), EventFlagsFromXEvent(xev),
|
||||
|
@ -96,7 +96,7 @@ void WaylandTouch::Down(void* data,
|
||||
gfx::Point location(wl_fixed_to_double(x), wl_fixed_to_double(y));
|
||||
base::TimeTicks time_stamp =
|
||||
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time);
|
||||
PointerDetails pointer_details(EventPointerType::POINTER_TYPE_TOUCH, id);
|
||||
PointerDetails pointer_details(EventPointerType::kTouch, id);
|
||||
TouchEvent event(type, location, time_stamp, pointer_details);
|
||||
touch->callback_.Run(&event);
|
||||
|
||||
@ -121,7 +121,7 @@ void WaylandTouch::Up(void* data,
|
||||
EventType type = ET_TOUCH_RELEASED;
|
||||
base::TimeTicks time_stamp =
|
||||
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time);
|
||||
PointerDetails pointer_details(EventPointerType::POINTER_TYPE_TOUCH, id);
|
||||
PointerDetails pointer_details(EventPointerType::kTouch, id);
|
||||
TouchEvent event(type, touch->current_points_[id].last_known_location,
|
||||
time_stamp, pointer_details);
|
||||
touch->callback_.Run(&event);
|
||||
@ -150,7 +150,7 @@ void WaylandTouch::Motion(void* data,
|
||||
gfx::Point location(wl_fixed_to_double(x), wl_fixed_to_double(y));
|
||||
base::TimeTicks time_stamp =
|
||||
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time);
|
||||
PointerDetails pointer_details(EventPointerType::POINTER_TYPE_TOUCH, id);
|
||||
PointerDetails pointer_details(EventPointerType::kTouch, id);
|
||||
TouchEvent event(type, location, time_stamp, pointer_details);
|
||||
touch->callback_.Run(&event);
|
||||
touch->current_points_[id].last_known_location = location;
|
||||
@ -166,7 +166,7 @@ void WaylandTouch::Cancel(void* data, wl_touch* obj) {
|
||||
|
||||
EventType type = ET_TOUCH_CANCELLED;
|
||||
base::TimeTicks time_stamp = base::TimeTicks::Now();
|
||||
PointerDetails pointer_details(EventPointerType::POINTER_TYPE_TOUCH, id);
|
||||
PointerDetails pointer_details(EventPointerType::kTouch, id);
|
||||
TouchEvent event(type, gfx::Point(), time_stamp, pointer_details);
|
||||
touch->callback_.Run(&event);
|
||||
|
||||
|
@ -220,7 +220,7 @@ TEST_F(InkDropHostViewTest, NoInkDropOnTouchOrGestureEvents) {
|
||||
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(5, 6), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
test_api_.AnimateInkDrop(InkDropState::ACTION_PENDING, &touch_event);
|
||||
EXPECT_EQ(test_api_.GetInkDrop()->GetTargetInkDropState(),
|
||||
@ -268,7 +268,7 @@ TEST_F(InkDropHostViewTest, DismissInkDropOnTouchOrGestureEvents) {
|
||||
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(5, 6), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
|
||||
test_api_.AnimateInkDrop(InkDropState::ACTION_TRIGGERED, &touch_event);
|
||||
EXPECT_EQ(test_api_.GetInkDrop()->GetTargetInkDropState(),
|
||||
|
@ -1518,7 +1518,7 @@ TEST_F(MenuControllerTest, NoTouchCloseWhenSendingGesturesToOwner) {
|
||||
location.Offset(1, 1);
|
||||
ui::TouchEvent touch_event(
|
||||
ui::ET_TOUCH_PRESSED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
controller->OnTouchEvent(sub_menu, &touch_event);
|
||||
|
||||
// Menu should still be visible.
|
||||
@ -1592,9 +1592,8 @@ TEST_F(MenuControllerTest, AsynchronousTouchEventRepostEvent) {
|
||||
sub_menu->ShowAt(owner(), item->bounds(), false);
|
||||
gfx::Point location(sub_menu->bounds().bottom_right());
|
||||
location.Offset(1, 1);
|
||||
ui::TouchEvent event(
|
||||
ui::ET_TOUCH_PRESSED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0));
|
||||
ui::TouchEvent event(ui::ET_TOUCH_PRESSED, location, ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
|
||||
controller->OnTouchEvent(sub_menu, &event);
|
||||
views::test::WaitForMenuClosureAnimation();
|
||||
|
||||
|
@ -704,7 +704,7 @@ bool Textfield::OnMousePressed(const ui::MouseEvent& event) {
|
||||
if (!handled &&
|
||||
(event.IsOnlyLeftMouseButton() || event.IsOnlyRightMouseButton())) {
|
||||
if (!had_focus)
|
||||
RequestFocusWithPointer(ui::EventPointerType::POINTER_TYPE_MOUSE);
|
||||
RequestFocusWithPointer(ui::EventPointerType::kMouse);
|
||||
#if !defined(OS_WIN)
|
||||
ShowVirtualKeyboardIfEnabled();
|
||||
#endif
|
||||
@ -712,7 +712,7 @@ bool Textfield::OnMousePressed(const ui::MouseEvent& event) {
|
||||
|
||||
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
if (!handled && !had_focus && event.IsOnlyMiddleMouseButton())
|
||||
RequestFocusWithPointer(ui::EventPointerType::POINTER_TYPE_MOUSE);
|
||||
RequestFocusWithPointer(ui::EventPointerType::kMouse);
|
||||
#endif
|
||||
|
||||
return selection_controller_.OnMousePressed(
|
||||
@ -2077,13 +2077,13 @@ void Textfield::RequestFocusWithPointer(ui::EventPointerType pointer_type) {
|
||||
return;
|
||||
|
||||
switch (pointer_type) {
|
||||
case ui::EventPointerType::POINTER_TYPE_MOUSE:
|
||||
case ui::EventPointerType::kMouse:
|
||||
focus_reason_ = ui::TextInputClient::FOCUS_REASON_MOUSE;
|
||||
break;
|
||||
case ui::EventPointerType::POINTER_TYPE_PEN:
|
||||
case ui::EventPointerType::kPen:
|
||||
focus_reason_ = ui::TextInputClient::FOCUS_REASON_PEN;
|
||||
break;
|
||||
case ui::EventPointerType::POINTER_TYPE_TOUCH:
|
||||
case ui::EventPointerType::kTouch:
|
||||
focus_reason_ = ui::TextInputClient::FOCUS_REASON_TOUCH;
|
||||
break;
|
||||
default:
|
||||
@ -2098,9 +2098,8 @@ void Textfield::RequestFocusForGesture(const ui::GestureEventDetails& details) {
|
||||
bool show_virtual_keyboard = true;
|
||||
#if defined(OS_WIN)
|
||||
show_virtual_keyboard =
|
||||
details.primary_pointer_type() ==
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH ||
|
||||
details.primary_pointer_type() == ui::EventPointerType::POINTER_TYPE_PEN;
|
||||
details.primary_pointer_type() == ui::EventPointerType::kTouch ||
|
||||
details.primary_pointer_type() == ui::EventPointerType::kPen;
|
||||
#endif
|
||||
|
||||
RequestFocusWithPointer(details.primary_pointer_type());
|
||||
|
@ -3742,8 +3742,7 @@ TEST_F(TextfieldTest, FocusReasonTouchTap) {
|
||||
textfield_->GetFocusReason());
|
||||
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_primary_pointer_type(
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kTouch);
|
||||
GestureEventForTest tap(GetCursorPositionX(0), 0, tap_details);
|
||||
textfield_->OnGestureEvent(&tap);
|
||||
|
||||
@ -3758,7 +3757,7 @@ TEST_F(TextfieldTest, FocusReasonPenTap) {
|
||||
textfield_->GetFocusReason());
|
||||
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kPen);
|
||||
GestureEventForTest tap(GetCursorPositionX(0), 0, tap_details);
|
||||
textfield_->OnGestureEvent(&tap);
|
||||
|
||||
@ -3775,16 +3774,14 @@ TEST_F(TextfieldTest, FocusReasonMultipleEvents) {
|
||||
// Pen tap, followed by a touch tap
|
||||
{
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_primary_pointer_type(
|
||||
ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kPen);
|
||||
GestureEventForTest tap(GetCursorPositionX(0), 0, tap_details);
|
||||
textfield_->OnGestureEvent(&tap);
|
||||
}
|
||||
|
||||
{
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_primary_pointer_type(
|
||||
ui::EventPointerType::POINTER_TYPE_TOUCH);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kTouch);
|
||||
GestureEventForTest tap(GetCursorPositionX(0), 0, tap_details);
|
||||
textfield_->OnGestureEvent(&tap);
|
||||
}
|
||||
@ -3801,7 +3798,7 @@ TEST_F(TextfieldTest, FocusReasonFocusBlurFocus) {
|
||||
|
||||
// Pen tap, blur, then programmatic focus.
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kPen);
|
||||
GestureEventForTest tap(GetCursorPositionX(0), 0, tap_details);
|
||||
textfield_->OnGestureEvent(&tap);
|
||||
|
||||
@ -3817,7 +3814,7 @@ TEST_F(TextfieldTest, KeyboardObserverForPenInput) {
|
||||
InitTextfield();
|
||||
|
||||
ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP_DOWN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::POINTER_TYPE_PEN);
|
||||
tap_details.set_primary_pointer_type(ui::EventPointerType::kPen);
|
||||
GestureEventForTest tap(GetCursorPositionX(0), 0, tap_details);
|
||||
textfield_->OnGestureEvent(&tap);
|
||||
|
||||
|
@ -643,7 +643,7 @@ void TouchSelectionControllerImpl::OnEvent(const ui::Event& event) {
|
||||
// from touch as this can clear an active selection generated by the pen.
|
||||
if ((event.flags() & (ui::EF_IS_SYNTHESIZED | ui::EF_FROM_TOUCH)) ||
|
||||
event.AsMouseEvent()->pointer_details().pointer_type ==
|
||||
ui::EventPointerType::POINTER_TYPE_PEN) {
|
||||
ui::EventPointerType::kPen) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -413,9 +413,9 @@ TEST_F(NativeWidgetAuraTest, DontCaptureOnGesture) {
|
||||
widget->SetContentsView(view);
|
||||
widget->Show();
|
||||
|
||||
ui::TouchEvent press(
|
||||
ui::ET_TOUCH_PRESSED, gfx::Point(41, 51), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(41, 51),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
ui::EventDispatchDetails details = event_sink()->OnEventFromSource(&press);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
// Both views should get the press.
|
||||
@ -428,9 +428,9 @@ TEST_F(NativeWidgetAuraTest, DontCaptureOnGesture) {
|
||||
|
||||
// Release touch. Only |view| should get the release since that it consumed
|
||||
// the press.
|
||||
ui::TouchEvent release(
|
||||
ui::ET_TOUCH_RELEASED, gfx::Point(250, 251), ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
|
||||
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(250, 251),
|
||||
ui::EventTimeForNow(),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
|
||||
details = event_sink()->OnEventFromSource(&release);
|
||||
ASSERT_FALSE(details.dispatcher_destroyed);
|
||||
EXPECT_TRUE(view->got_gesture_event());
|
||||
|
@ -3121,9 +3121,8 @@ LRESULT HWNDMessageHandler::HandlePointerEventTypeTouch(UINT message,
|
||||
|
||||
ui::TouchEvent event(
|
||||
event_type, touch_point, event_time,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH,
|
||||
mapped_pointer_id, radius_x, radius_y, pressure,
|
||||
rotation_angle),
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, mapped_pointer_id,
|
||||
radius_x, radius_y, pressure, rotation_angle),
|
||||
ui::GetModifiersFromKeyState());
|
||||
|
||||
event.latency()->AddLatencyNumberWithTimestamp(
|
||||
@ -3277,9 +3276,8 @@ void HWNDMessageHandler::GenerateTouchEvent(ui::EventType event_type,
|
||||
size_t id,
|
||||
base::TimeTicks time_stamp,
|
||||
TouchEvents* touch_events) {
|
||||
ui::TouchEvent event(
|
||||
event_type, point, time_stamp,
|
||||
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, id));
|
||||
ui::TouchEvent event(event_type, point, time_stamp,
|
||||
ui::PointerDetails(ui::EventPointerType::kTouch, id));
|
||||
|
||||
event.set_flags(ui::GetModifiersFromKeyState());
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user