Remove ui::input_types nested namespace
ui::EventType is being moved to //ui/event/types/ directory (crrev/c/2028629). Currently, that directory needs types be put inside ui::input_types. This would mean that input_types should be repeated in many many places without much benefit in clarity. To be consistent across this directory, we are removing the input_types namespace altoghether. Bug: 963781 Change-Id: I91fc42ca84bd112357989e024a732dcbabbedc39 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031532 Commit-Queue: Mohsen Izadi <mohsen@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Ken Buchanan <kenrb@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#739740}
This commit is contained in:
cc
input
input_handler.ccinput_handler.hscroll_state.hscroll_state_data.ccscroll_state_data.hscrollbar_controller.ccscrollbar_controller.h
trees
content
browser
frame_host
renderer_host
input
autoscroll_browsertest.cccompositor_event_ack_browsertest.ccfling_browsertest.ccfling_controller.ccfling_controller_unittest.ccinput_router_impl_unittest.ccmouse_wheel_event_queue.ccmouse_wheel_event_queue_unittest.ccscroll_latency_browsertest.ccsynthetic_gesture_controller_unittest.ccsynthetic_gesture_target_aura.ccsynthetic_gesture_target_base.ccsynthetic_input_browsertest.ccsynthetic_smooth_move_gesture.ccsynthetic_smooth_move_gesture.htouchpad_pinch_event_queue.ccweb_input_event_builders_android.ccweb_input_event_builders_mac.mmwheel_event_listener_browsertest.ccwheel_scroll_latching_browsertest.cc
overscroll_controller.ccoverscroll_controller_unittest.ccrender_widget_host_input_event_router.ccrender_widget_host_unittest.ccrender_widget_host_view_aura_unittest.ccweb_contents
common
input
public
renderer
shell
test_runner
third_party/blink
common
input
public
renderer
core
events
frame
input
page
scrolling
scroll
testing
tools
blinkpy
presubmit
ui/events
blink
blink_event_util.ccblink_event_util.hblink_event_util_unittest.ccfling_booster_unittest.ccinput_handler_proxy.ccinput_handler_proxy_unittest.ccinput_scroll_elasticity_controller.ccweb_input_event.ccweb_input_event_builders_win.ccweb_input_event_builders_win_unittest.cc
gesture_event_details.ccgesture_event_details.hipc
mojom
types
@ -12,6 +12,6 @@ InputHandlerScrollResult::InputHandlerScrollResult()
|
||||
|
||||
InputHandlerPointerResult::InputHandlerPointerResult()
|
||||
: type(kUnhandled),
|
||||
scroll_units(ui::input_types::ScrollGranularity::kScrollByPrecisePixel) {}
|
||||
scroll_units(ui::ScrollGranularity::kScrollByPrecisePixel) {}
|
||||
|
||||
} // namespace cc
|
||||
|
@ -44,7 +44,7 @@ struct CC_EXPORT InputHandlerPointerResult {
|
||||
PointerResultType type;
|
||||
|
||||
// Tells what scroll_units should be used.
|
||||
ui::input_types::ScrollGranularity scroll_units;
|
||||
ui::ScrollGranularity scroll_units;
|
||||
|
||||
// If the input handler processed the event as a scrollbar scroll, it will
|
||||
// return a gfx::ScrollOffset that produces the necessary scroll. However,
|
||||
|
@ -77,7 +77,7 @@ class CC_EXPORT ScrollState {
|
||||
|
||||
bool is_scroll_chain_cut() const { return data_.is_scroll_chain_cut; }
|
||||
|
||||
ui::input_types::ScrollGranularity delta_granularity() const {
|
||||
ui::ScrollGranularity delta_granularity() const {
|
||||
return data_.delta_granularity;
|
||||
}
|
||||
|
||||
|
@ -22,8 +22,7 @@ ScrollStateData::ScrollStateData()
|
||||
from_user_input(false),
|
||||
delta_consumed_for_scroll_sequence(false),
|
||||
is_direct_manipulation(false),
|
||||
delta_granularity(
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel),
|
||||
delta_granularity(ui::ScrollGranularity::kScrollByPrecisePixel),
|
||||
caused_scroll_x(false),
|
||||
caused_scroll_y(false),
|
||||
is_scroll_chain_cut(false) {}
|
||||
|
@ -49,7 +49,7 @@ class CC_EXPORT ScrollStateData {
|
||||
bool is_direct_manipulation;
|
||||
|
||||
// Granularity units for the scroll delta.
|
||||
ui::input_types::ScrollGranularity delta_granularity;
|
||||
ui::ScrollGranularity delta_granularity;
|
||||
|
||||
// TODO(tdresser): ScrollState shouldn't need to keep track of whether or not
|
||||
// this ScrollState object has caused a scroll. Ideally, any native scroller
|
||||
|
@ -187,18 +187,18 @@ bool ScrollbarController::SnapToDragOrigin(
|
||||
pointer_location > gutter_max_bound;
|
||||
}
|
||||
|
||||
ui::input_types::ScrollGranularity ScrollbarController::Granularity(
|
||||
ui::ScrollGranularity ScrollbarController::Granularity(
|
||||
const ScrollbarPart scrollbar_part,
|
||||
const bool shift_modifier) {
|
||||
const bool shift_click_on_scrollbar_track =
|
||||
shift_modifier && (scrollbar_part == ScrollbarPart::FORWARD_TRACK ||
|
||||
scrollbar_part == ScrollbarPart::BACK_TRACK);
|
||||
if (shift_click_on_scrollbar_track || scrollbar_part == ScrollbarPart::THUMB)
|
||||
return ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
return ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
|
||||
// TODO(arakeri): This needs to be updated to kLine once cc implements
|
||||
// handling it. crbug.com/959441
|
||||
return ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
return ui::ScrollGranularity::kScrollByPixel;
|
||||
}
|
||||
|
||||
float ScrollbarController::GetScrollDeltaForAbsoluteJump(
|
||||
@ -346,8 +346,7 @@ InputHandlerPointerResult ScrollbarController::HandlePointerMove(
|
||||
|
||||
// Thumb drags have more granularity and are purely dependent on the pointer
|
||||
// movement. Hence we use kPrecisePixel when dragging the thumb.
|
||||
scroll_result.scroll_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_result.scroll_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_result.scroll_offset = gfx::ScrollOffset(clamped_scroll_offset);
|
||||
drag_processed_for_current_frame_ = true;
|
||||
|
||||
|
@ -230,9 +230,8 @@ class CC_EXPORT ScrollbarController {
|
||||
float GetScrollDeltaForAbsoluteJump(const ScrollbarLayerImplBase* scrollbar);
|
||||
|
||||
// Determines if the delta needs to be animated.
|
||||
ui::input_types::ScrollGranularity Granularity(
|
||||
const ScrollbarPart scrollbar_part,
|
||||
bool shift_modifier);
|
||||
ui::ScrollGranularity Granularity(const ScrollbarPart scrollbar_part,
|
||||
bool shift_modifier);
|
||||
|
||||
// Calculates the scroll_offset based on position_in_widget and
|
||||
// drag_anchor_relative_to_thumb_.
|
||||
|
@ -3882,7 +3882,7 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
|
||||
// decide when it best makes sense to cancel a scroll animation (maybe
|
||||
// ScrollBy is a better place to do it).
|
||||
if (scroll_state->delta_granularity() ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
mutator_host_->ScrollAnimationAbort();
|
||||
scroll_animating_snap_target_ids_ = TargetSnapAreaElementIds();
|
||||
}
|
||||
@ -4618,9 +4618,8 @@ bool LayerTreeHostImpl::ShouldAnimateScroll(
|
||||
if (!settings_.enable_smooth_scroll)
|
||||
return false;
|
||||
|
||||
bool has_precise_scroll_deltas =
|
||||
scroll_state.delta_granularity() ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
bool has_precise_scroll_deltas = scroll_state.delta_granularity() ==
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
if (has_precise_scroll_deltas)
|
||||
@ -4642,9 +4641,8 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollUpdate(
|
||||
DCHECK(scroll_state);
|
||||
last_scroll_state_ = *scroll_state;
|
||||
|
||||
bool is_delta_percent_units =
|
||||
scroll_state->delta_granularity() ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage;
|
||||
bool is_delta_percent_units = scroll_state->delta_granularity() ==
|
||||
ui::ScrollGranularity::kScrollByPercentage;
|
||||
if (CurrentlyScrollingNode() && is_delta_percent_units) {
|
||||
gfx::Vector2dF resolvedScrollDelta = ResolveScrollPercentageToPixels(
|
||||
*CurrentlyScrollingNode(),
|
||||
@ -4653,7 +4651,7 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollUpdate(
|
||||
scroll_state->data()->delta_x = resolvedScrollDelta.x();
|
||||
scroll_state->data()->delta_y = resolvedScrollDelta.y();
|
||||
scroll_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
}
|
||||
|
||||
gfx::Vector2dF scroll_delta(scroll_state->delta_x(), scroll_state->delta_y());
|
||||
@ -4828,7 +4826,7 @@ bool LayerTreeHostImpl::SnapAtScrollEnd() {
|
||||
bool imprecise_wheel_scrolling =
|
||||
latched_scroll_type_ == InputHandler::WHEEL &&
|
||||
last_scroll_state_->delta_granularity() !=
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gfx::ScrollOffset last_scroll_delta(last_scroll_state_->delta_x(),
|
||||
last_scroll_state_->delta_y());
|
||||
|
||||
@ -6161,7 +6159,7 @@ void LayerTreeHostImpl::UpdateScrollSourceInfo(
|
||||
InputHandler::ScrollInputType type) {
|
||||
if (type == InputHandler::WHEEL &&
|
||||
scroll_state.delta_granularity() ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
has_scrolled_by_precisiontouchpad_ = true;
|
||||
} else if (type == InputHandler::WHEEL) {
|
||||
has_scrolled_by_wheel_ = true;
|
||||
|
@ -612,8 +612,7 @@ class LayerTreeHostImplTest : public testing::Test,
|
||||
const gfx::Point& point,
|
||||
const gfx::Vector2dF& delta) {
|
||||
auto state = UpdateState(point, delta, InputHandler::WHEEL);
|
||||
state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
state->data()->delta_granularity = ui::ScrollGranularity::kScrollByPixel;
|
||||
return state;
|
||||
}
|
||||
|
||||
@ -1957,7 +1956,7 @@ TEST_F(LayerTreeHostImplTest, SnapAnimationCancelledByScroll) {
|
||||
// Interrupt the snap animation with ScrollBegin.
|
||||
auto begin_state = BeginState(pointer_position, x_delta, InputHandler::WHEEL);
|
||||
begin_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
EXPECT_EQ(
|
||||
InputHandler::SCROLL_ON_IMPL_THREAD,
|
||||
host_impl_->ScrollBegin(begin_state.get(), InputHandler::WHEEL).thread);
|
||||
@ -4001,11 +4000,11 @@ TEST_F(LayerTreeHostImplTest, AnimatedGranularityCausesSmoothScroll) {
|
||||
begin_state->data()->set_current_native_scrolling_element(
|
||||
host_impl_->OuterViewportScrollNode()->element_id);
|
||||
begin_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
|
||||
auto update_state = UpdateState(position, offset, type);
|
||||
update_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
|
||||
ASSERT_FALSE(GetImplAnimationHost()->IsImplOnlyScrollAnimating());
|
||||
|
||||
@ -4030,9 +4029,9 @@ TEST_F(LayerTreeHostImplTest, AnimatedGranularityCausesSmoothScroll) {
|
||||
// if thumb-dragging). This should not cause an animation.
|
||||
{
|
||||
begin_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
update_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
|
||||
host_impl_->ScrollBegin(begin_state.get(), type);
|
||||
ASSERT_EQ(host_impl_->CurrentlyScrollingNode(),
|
||||
@ -4068,11 +4067,11 @@ TEST_F(LayerTreeHostImplTest, NonAnimatedGranularityCausesInstantScroll) {
|
||||
begin_state->data()->set_current_native_scrolling_element(
|
||||
host_impl_->OuterViewportScrollNode()->element_id);
|
||||
begin_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
|
||||
auto update_state = UpdateState(position, offset, type);
|
||||
update_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
|
||||
ASSERT_FALSE(GetImplAnimationHost()->IsImplOnlyScrollAnimating());
|
||||
|
||||
@ -12354,7 +12353,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedAborted) {
|
||||
auto begin_state =
|
||||
BeginState(gfx::Point(0, y), gfx::Vector2dF(0, 50), InputHandler::WHEEL);
|
||||
begin_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
EXPECT_EQ(
|
||||
InputHandler::SCROLL_ON_IMPL_THREAD,
|
||||
host_impl_->ScrollBegin(begin_state.get(), InputHandler::WHEEL).thread);
|
||||
@ -12363,7 +12362,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedAborted) {
|
||||
UpdateState(gfx::Point(0, y), gfx::Vector2d(0, 50), InputHandler::WHEEL);
|
||||
// Use "precise pixel" granularity to avoid animating.
|
||||
update_state->data()->delta_granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
host_impl_->ScrollUpdate(update_state.get());
|
||||
EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(0, y + 50)));
|
||||
host_impl_->ScrollEnd();
|
||||
|
@ -4248,7 +4248,7 @@ void RenderFrameHostImpl::ScrollRectToVisibleInParentFrame(
|
||||
|
||||
void RenderFrameHostImpl::BubbleLogicalScrollInParentFrame(
|
||||
blink::mojom::ScrollDirection direction,
|
||||
ui::input_types::ScrollGranularity granularity) {
|
||||
ui::ScrollGranularity granularity) {
|
||||
if (!is_active())
|
||||
return;
|
||||
|
||||
|
@ -1354,7 +1354,7 @@ class CONTENT_EXPORT RenderFrameHostImpl
|
||||
blink::mojom::ScrollIntoViewParamsPtr params) override;
|
||||
void BubbleLogicalScrollInParentFrame(
|
||||
blink::mojom::ScrollDirection direction,
|
||||
ui::input_types::ScrollGranularity granularity) override;
|
||||
ui::ScrollGranularity granularity) override;
|
||||
void DidAccessInitialDocument() override;
|
||||
void DidBlockNavigation(
|
||||
const GURL& blocked_url,
|
||||
|
@ -271,8 +271,7 @@ IN_PROC_BROWSER_TEST_F(AutoscrollBrowserTest,
|
||||
GetWidgetHost()->render_frame_metadata_provider());
|
||||
blink::WebMouseWheelEvent wheel_event =
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
10, 10, 0, -53, 0,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
10, 10, 0, -53, 0, ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
GetWidgetHost()->ForwardWheelEvent(wheel_event);
|
||||
WaitForScroll(observer);
|
||||
@ -292,8 +291,7 @@ IN_PROC_BROWSER_TEST_F(AutoscrollBrowserTest,
|
||||
GetWidgetHost()->render_frame_metadata_provider());
|
||||
blink::WebMouseWheelEvent wheel_event =
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
10, 10, 0, -53, 0,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
10, 10, 0, -53, 0, ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
GetWidgetHost()->ForwardWheelEvent(wheel_event);
|
||||
|
||||
|
@ -166,8 +166,7 @@ class CompositorEventAckBrowserTest : public ContentBrowserTest {
|
||||
// will block the renderer's main thread once it is received.
|
||||
blink::WebMouseWheelEvent wheel_event =
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
10, 10, 0, -53, 0,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
10, 10, 0, -53, 0, ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
GetWidgetHost()->ForwardWheelEvent(wheel_event);
|
||||
|
||||
@ -268,7 +267,7 @@ IN_PROC_BROWSER_TEST_F(CompositorEventAckBrowserTest,
|
||||
blink::WebInputEvent::kNoModifiers, ui::EventTimeForNow());
|
||||
gesture_scroll_begin.SetSourceDevice(blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_x_hint = 0.f;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_y_hint = -5.f;
|
||||
GetWidgetHost()->ForwardGestureEvent(gesture_scroll_begin);
|
||||
|
@ -153,7 +153,7 @@ class BrowserSideFlingBrowserTest : public ContentBrowserTest {
|
||||
blink::WebInputEvent::kNoModifiers, ui::EventTimeForNow());
|
||||
gesture_scroll_begin.SetSourceDevice(blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_x_hint = fling_velocity.x();
|
||||
gesture_scroll_begin.data.scroll_begin.delta_y_hint = fling_velocity.y();
|
||||
const gfx::PointF scroll_location_in_widget(1, 1);
|
||||
@ -200,7 +200,7 @@ class BrowserSideFlingBrowserTest : public ContentBrowserTest {
|
||||
blink::WebMouseWheelEvent wheel_event =
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
10, 10, fling_velocity.x() / 1000, fling_velocity.y() / 1000, 0,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
const gfx::PointF position_in_widget(1, 1);
|
||||
const gfx::PointF position_in_root =
|
||||
|
@ -263,7 +263,7 @@ void FlingController::GenerateAndSendWheelEvents(
|
||||
WebInputEvent::kMouseWheel, current_fling_parameters_.modifiers,
|
||||
clock_->NowTicks(), ui::LatencyInfo(ui::SourceEventType::WHEEL));
|
||||
synthetic_wheel.event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
synthetic_wheel.event.delta_x = delta.x();
|
||||
synthetic_wheel.event.delta_y = delta.y();
|
||||
synthetic_wheel.event.momentum_phase = phase;
|
||||
|
@ -116,7 +116,7 @@ class FlingControllerTest : public FlingControllerEventSenderClient,
|
||||
scroll_begin.data.scroll_begin.inertial_phase =
|
||||
WebGestureEvent::InertialPhaseState::kNonMomentum;
|
||||
scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
GestureEventWithLatencyInfo scroll_begin_with_latency(scroll_begin);
|
||||
|
||||
fling_controller_->ObserveAndMaybeConsumeGestureEvent(
|
||||
@ -134,7 +134,7 @@ class FlingControllerTest : public FlingControllerEventSenderClient,
|
||||
scroll_update.data.scroll_update.inertial_phase =
|
||||
WebGestureEvent::InertialPhaseState::kNonMomentum;
|
||||
scroll_update.data.scroll_update.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
GestureEventWithLatencyInfo scroll_update_with_latency(scroll_update);
|
||||
|
||||
fling_controller_->ObserveAndMaybeConsumeGestureEvent(
|
||||
|
@ -271,8 +271,8 @@ class InputRouterImplTestBase : public testing::Test {
|
||||
WebMouseWheelEvent::Phase phase) {
|
||||
WebMouseWheelEvent wheel_event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
x, y, dX, dY, modifiers,
|
||||
precise ? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
precise ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel);
|
||||
wheel_event.phase = phase;
|
||||
input_router_->SendWheelEvent(MouseWheelEventWithLatencyInfo(wheel_event));
|
||||
}
|
||||
|
@ -153,18 +153,18 @@ void MouseWheelEventQueue::ProcessMouseWheelAck(
|
||||
|
||||
// WebMouseWheelEvent only supports these units for the delta.
|
||||
DCHECK(event_sent_for_gesture_ack_->event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPage ||
|
||||
ui::ScrollGranularity::kScrollByPage ||
|
||||
event_sent_for_gesture_ack_->event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel ||
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel ||
|
||||
event_sent_for_gesture_ack_->event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel ||
|
||||
ui::ScrollGranularity::kScrollByPixel ||
|
||||
event_sent_for_gesture_ack_->event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage);
|
||||
ui::ScrollGranularity::kScrollByPercentage);
|
||||
scroll_update.data.scroll_update.delta_units =
|
||||
event_sent_for_gesture_ack_->event.delta_units;
|
||||
|
||||
if (event_sent_for_gesture_ack_->event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPage) {
|
||||
ui::ScrollGranularity::kScrollByPage) {
|
||||
// Turn page scrolls into a *single* page scroll because
|
||||
// the magnitude the number of ticks is lost when coalescing.
|
||||
if (scroll_update.data.scroll_update.delta_x)
|
||||
|
@ -253,9 +253,8 @@ class MouseWheelEventQueueTest : public testing::Test,
|
||||
bool has_synthetic_phase = false) {
|
||||
WebMouseWheelEvent event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
x, y, global_x, global_y, dX, dY, modifiers,
|
||||
high_precision
|
||||
? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
high_precision ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel);
|
||||
event.phase = phase;
|
||||
event.momentum_phase = momentum_phase;
|
||||
event.rails_mode = rails_mode;
|
||||
@ -294,10 +293,9 @@ class MouseWheelEventQueueTest : public testing::Test,
|
||||
}
|
||||
|
||||
void GestureSendingTest(bool high_precision) {
|
||||
const ui::input_types::ScrollGranularity scroll_units =
|
||||
high_precision
|
||||
? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
const ui::ScrollGranularity scroll_units =
|
||||
high_precision ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel;
|
||||
SendMouseWheel(kWheelScrollX, kWheelScrollY, kWheelScrollGlobalX,
|
||||
kWheelScrollGlobalY, 1, 1, 0, high_precision,
|
||||
WebMouseWheelEvent::kPhaseBegan,
|
||||
@ -331,10 +329,9 @@ class MouseWheelEventQueueTest : public testing::Test,
|
||||
}
|
||||
|
||||
void PhaseGestureSendingTest(bool high_precision) {
|
||||
const ui::input_types::ScrollGranularity scroll_units =
|
||||
high_precision
|
||||
? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
const ui::ScrollGranularity scroll_units =
|
||||
high_precision ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel;
|
||||
|
||||
SendMouseWheel(kWheelScrollX, kWheelScrollY, kWheelScrollGlobalX,
|
||||
kWheelScrollGlobalY, 1, 1, 0, high_precision,
|
||||
@ -461,8 +458,8 @@ TEST_F(MouseWheelEventQueueTest,
|
||||
// scroll_end.data.scroll_end.generated_by_fling_controller.
|
||||
#if defined(CHROME_OS)
|
||||
TEST_F(MouseWheelEventQueueTest, WheelEndWithMomentumPhaseEndedInformation) {
|
||||
const ui::input_types::ScrollGranularity scroll_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
const ui::ScrollGranularity scroll_units =
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
SendMouseWheel(kWheelScrollX, kWheelScrollY, kWheelScrollGlobalX,
|
||||
kWheelScrollGlobalY, 1, 1, 0, true /* high_precision */,
|
||||
WebMouseWheelEvent::kPhaseBegan,
|
||||
@ -491,8 +488,8 @@ TEST_F(MouseWheelEventQueueTest, WheelEndWithMomentumPhaseEndedInformation) {
|
||||
#endif // defined(CHROME_OS)
|
||||
|
||||
TEST_F(MouseWheelEventQueueTest, GestureSendingInterrupted) {
|
||||
const ui::input_types::ScrollGranularity scroll_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
const ui::ScrollGranularity scroll_units =
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
SendMouseWheel(kWheelScrollX, kWheelScrollY, kWheelScrollGlobalX,
|
||||
kWheelScrollGlobalY, 1, 1, 0, false,
|
||||
WebMouseWheelEvent::kPhaseBegan,
|
||||
@ -572,8 +569,8 @@ TEST_F(MouseWheelEventQueueTest, GestureSendingInterrupted) {
|
||||
}
|
||||
|
||||
TEST_F(MouseWheelEventQueueTest, GestureRailScrolling) {
|
||||
const ui::input_types::ScrollGranularity scroll_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
const ui::ScrollGranularity scroll_units =
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
SendMouseWheel(
|
||||
kWheelScrollX, kWheelScrollY, kWheelScrollGlobalX, kWheelScrollGlobalY, 1,
|
||||
1, 0, false, WebMouseWheelEvent::kPhaseBegan,
|
||||
@ -622,8 +619,8 @@ TEST_F(MouseWheelEventQueueTest, GestureRailScrolling) {
|
||||
}
|
||||
|
||||
TEST_F(MouseWheelEventQueueTest, WheelScrollLatching) {
|
||||
const ui::input_types::ScrollGranularity scroll_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
const ui::ScrollGranularity scroll_units =
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
SendMouseWheel(
|
||||
kWheelScrollX, kWheelScrollY, kWheelScrollGlobalX, kWheelScrollGlobalY, 1,
|
||||
1, 0, false, WebMouseWheelEvent::kPhaseBegan,
|
||||
|
@ -126,7 +126,7 @@ class ScrollLatencyBrowserTest : public ContentBrowserTest {
|
||||
SyntheticWebGestureEventBuilder::BuildScrollBegin(
|
||||
distance.x(), -distance.y(), blink::WebGestureDevice::kTouchpad, 1);
|
||||
event.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
GetWidgetHost()->ForwardGestureEvent(event);
|
||||
|
||||
const uint32_t kNumWheelScrolls = 2;
|
||||
@ -146,7 +146,7 @@ class ScrollLatencyBrowserTest : public ContentBrowserTest {
|
||||
distance.x(), -distance.y(), 0,
|
||||
blink::WebGestureDevice::kTouchpad);
|
||||
event2.data.scroll_update.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
ui::ScrollGranularity::kScrollByPixel;
|
||||
GetWidgetHost()->ForwardGestureEvent(event2);
|
||||
|
||||
while (visual_state_callback_count_ <= i) {
|
||||
|
@ -205,7 +205,7 @@ class MockMoveGestureTarget : public MockSyntheticGestureTarget {
|
||||
public:
|
||||
MockMoveGestureTarget()
|
||||
: total_abs_move_distance_length_(0),
|
||||
granularity_(ui::input_types::ScrollGranularity::kScrollByPixel) {}
|
||||
granularity_(ui::ScrollGranularity::kScrollByPixel) {}
|
||||
~MockMoveGestureTarget() override {}
|
||||
|
||||
gfx::Vector2dF start_to_end_distance() const {
|
||||
@ -215,14 +215,12 @@ class MockMoveGestureTarget : public MockSyntheticGestureTarget {
|
||||
return total_abs_move_distance_length_;
|
||||
}
|
||||
|
||||
ui::input_types::ScrollGranularity granularity() const {
|
||||
return granularity_;
|
||||
}
|
||||
ui::ScrollGranularity granularity() const { return granularity_; }
|
||||
|
||||
protected:
|
||||
gfx::Vector2dF start_to_end_distance_;
|
||||
float total_abs_move_distance_length_;
|
||||
ui::input_types::ScrollGranularity granularity_;
|
||||
ui::ScrollGranularity granularity_;
|
||||
};
|
||||
|
||||
class MockScrollMouseTarget : public MockMoveGestureTarget {
|
||||
@ -1280,8 +1278,7 @@ TEST_F(SyntheticGestureControllerTest, SingleScrollGestureMousePreciseScroll) {
|
||||
params.input_type = SyntheticSmoothMoveGestureParams::MOUSE_WHEEL_INPUT;
|
||||
params.start_point.SetPoint(39, 86);
|
||||
params.distances.push_back(gfx::Vector2d(0, -132));
|
||||
params.granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
params.granularity = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
|
||||
std::unique_ptr<SyntheticSmoothMoveGesture> gesture(
|
||||
new SyntheticSmoothMoveGesture(params));
|
||||
@ -1302,7 +1299,7 @@ TEST_F(SyntheticGestureControllerTest, SingleScrollGestureMouseScrollByPage) {
|
||||
params.input_type = SyntheticSmoothMoveGestureParams::MOUSE_WHEEL_INPUT;
|
||||
params.start_point.SetPoint(39, 86);
|
||||
params.distances.push_back(gfx::Vector2d(0, -132));
|
||||
params.granularity = ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
params.granularity = ui::ScrollGranularity::kScrollByPage;
|
||||
|
||||
std::unique_ptr<SyntheticSmoothMoveGesture> gesture(
|
||||
new SyntheticSmoothMoveGesture(params));
|
||||
|
@ -84,11 +84,9 @@ void SyntheticGestureTargetAura::DispatchWebMouseWheelEventToPlatform(
|
||||
}
|
||||
base::TimeTicks timestamp = web_wheel.TimeStamp();
|
||||
int modifiers = ui::EF_NONE;
|
||||
if (web_wheel.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
if (web_wheel.delta_units == ui::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
modifiers |= ui::EF_PRECISION_SCROLLING_DELTA;
|
||||
} else if (web_wheel.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPage) {
|
||||
} else if (web_wheel.delta_units == ui::ScrollGranularity::kScrollByPage) {
|
||||
modifiers |= ui::EF_SCROLL_BY_PAGE;
|
||||
}
|
||||
|
||||
|
@ -67,8 +67,7 @@ void SyntheticGestureTargetBase::DispatchInputEventToPlatform(
|
||||
LOG(WARNING) << "Mouse wheel position is not within content bounds.";
|
||||
return;
|
||||
}
|
||||
if (web_wheel.delta_units !=
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage)
|
||||
if (web_wheel.delta_units != ui::ScrollGranularity::kScrollByPercentage)
|
||||
DispatchWebMouseWheelEventToPlatform(web_wheel, latency_info);
|
||||
else {
|
||||
// Percentage-based mouse wheel scrolls are implemented in the UI layer by
|
||||
|
@ -137,8 +137,7 @@ IN_PROC_BROWSER_TEST_F(SyntheticInputTest, SmoothScrollWheel) {
|
||||
params.speed_in_pixels_s = 10000000.f;
|
||||
|
||||
// Use PrecisePixel to avoid animating.
|
||||
params.granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
params.granularity = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
|
||||
runner_.reset(new base::RunLoop());
|
||||
|
||||
|
@ -47,7 +47,7 @@ SyntheticSmoothMoveGestureParams::SyntheticSmoothMoveGestureParams()
|
||||
fling_velocity_y(0),
|
||||
prevent_fling(true),
|
||||
add_slop(true),
|
||||
granularity(ui::input_types::ScrollGranularity::kScrollByPixel) {}
|
||||
granularity(ui::ScrollGranularity::kScrollByPixel) {}
|
||||
|
||||
SyntheticSmoothMoveGestureParams::SyntheticSmoothMoveGestureParams(
|
||||
const SyntheticSmoothMoveGestureParams& other) = default;
|
||||
|
@ -39,7 +39,7 @@ class CONTENT_EXPORT SyntheticSmoothMoveGestureParams {
|
||||
int fling_velocity_y;
|
||||
bool prevent_fling;
|
||||
bool add_slop;
|
||||
ui::input_types::ScrollGranularity granularity;
|
||||
ui::ScrollGranularity granularity;
|
||||
};
|
||||
|
||||
// This class is used as helper class for simulation of scroll and drag.
|
||||
|
@ -52,8 +52,7 @@ blink::WebMouseWheelEvent CreateSyntheticWheelFromTouchpadPinchEvent(
|
||||
pinch_event.TimeStamp());
|
||||
wheel_event.SetPositionInWidget(pinch_event.PositionInWidget());
|
||||
wheel_event.SetPositionInScreen(pinch_event.PositionInScreen());
|
||||
wheel_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
wheel_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
wheel_event.delta_x = 0;
|
||||
wheel_event.delta_y = delta_y;
|
||||
|
||||
|
@ -158,8 +158,7 @@ WebMouseWheelEvent WebMouseWheelEventBuilder::Build(
|
||||
result.SetPositionInWidget(motion_event.GetX(0), motion_event.GetY(0));
|
||||
result.SetPositionInScreen(motion_event.GetRawX(0), motion_event.GetRawY(0));
|
||||
result.button = WebMouseEvent::Button::kNoButton;
|
||||
result.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
result.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
result.delta_x = motion_event.ticks_x() * motion_event.GetTickMultiplier();
|
||||
result.delta_y = motion_event.ticks_y() * motion_event.GetTickMultiplier();
|
||||
result.wheel_ticks_x = motion_event.ticks_x();
|
||||
|
@ -555,8 +555,7 @@ blink::WebMouseWheelEvent WebMouseWheelEventBuilder::Build(
|
||||
// from data from any other continuous device.
|
||||
|
||||
if (CGEventGetIntegerValueField(cg_event, kCGScrollWheelEventIsContinuous)) {
|
||||
result.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
result.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
result.delta_x = CGEventGetIntegerValueField(
|
||||
cg_event, kCGScrollWheelEventPointDeltaAxis2);
|
||||
result.delta_y = CGEventGetIntegerValueField(
|
||||
|
@ -86,7 +86,7 @@ class WheelEventListenerBrowserTest : public ContentBrowserTest {
|
||||
blink::WebMouseWheelEvent wheel_event =
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
x, y, x, y, -20, -20, 0,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
GetWidgetHost()->ForwardWheelEvent(wheel_event);
|
||||
EXPECT_EQ(INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING,
|
||||
|
@ -168,7 +168,7 @@ IN_PROC_BROWSER_TEST_F(WheelScrollLatchingBrowserTest, MAYBE_WheelEventTarget) {
|
||||
blink::WebMouseWheelEvent wheel_event =
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
x, y, x, y, delta_x, delta_y, 0,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
|
||||
wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
GetRouter()->RouteMouseWheelEvent(GetRootView(), &wheel_event,
|
||||
@ -222,7 +222,7 @@ IN_PROC_BROWSER_TEST_F(WheelScrollLatchingBrowserTest,
|
||||
blink::WebMouseWheelEvent wheel_event =
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
x, y, x, y, delta_x, delta_y, 0,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
GetRouter()->RouteMouseWheelEvent(GetRootView(), &wheel_event,
|
||||
ui::LatencyInfo());
|
||||
@ -290,8 +290,8 @@ IN_PROC_BROWSER_TEST_F(WheelScrollLatchingBrowserTest,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests(),
|
||||
blink::WebGestureDevice::kTouchpad);
|
||||
gesture_scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
precise ? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
precise ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_x_hint = 0.f;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_y_hint = -20.f;
|
||||
gesture_scroll_begin.SetPositionInWidget(gfx::PointF(x, y));
|
||||
@ -302,8 +302,8 @@ IN_PROC_BROWSER_TEST_F(WheelScrollLatchingBrowserTest,
|
||||
blink::WebGestureEvent gesture_scroll_update(gesture_scroll_begin);
|
||||
gesture_scroll_update.SetType(blink::WebGestureEvent::kGestureScrollUpdate);
|
||||
gesture_scroll_update.data.scroll_update.delta_units =
|
||||
precise ? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
precise ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel;
|
||||
gesture_scroll_update.data.scroll_update.delta_x = 0.f;
|
||||
gesture_scroll_update.data.scroll_update.delta_y = -20.f;
|
||||
GetRootView()->ProcessGestureEvent(gesture_scroll_update, ui::LatencyInfo());
|
||||
@ -381,8 +381,7 @@ IN_PROC_BROWSER_TEST_F(WheelScrollLatchingBrowserTest,
|
||||
GetWidgetHost(), blink::WebInputEvent::kMouseWheel);
|
||||
blink::WebMouseWheelEvent wheel_event =
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
x, y, x, y, 1, 1, 0,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
x, y, x, y, 1, 1, 0, ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
GetRouter()->RouteMouseWheelEvent(GetRootView(), &wheel_event,
|
||||
ui::LatencyInfo());
|
||||
|
@ -68,7 +68,7 @@ bool OverscrollController::ShouldProcessEvent(
|
||||
if (IsGestureEventFromAutoscroll(gesture))
|
||||
return false;
|
||||
|
||||
ui::input_types::ScrollGranularity granularity;
|
||||
ui::ScrollGranularity granularity;
|
||||
switch (event.GetType()) {
|
||||
case blink::WebInputEvent::kGestureScrollBegin:
|
||||
granularity = gesture.data.scroll_begin.delta_hint_units;
|
||||
@ -80,12 +80,11 @@ bool OverscrollController::ShouldProcessEvent(
|
||||
granularity = gesture.data.scroll_end.delta_units;
|
||||
break;
|
||||
default:
|
||||
granularity = ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
granularity = ui::ScrollGranularity::kScrollByPixel;
|
||||
break;
|
||||
}
|
||||
|
||||
return granularity ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
return granularity == ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
@ -44,8 +44,7 @@ class OverscrollControllerTest : public ::testing::Test {
|
||||
DCHECK(!current_event_);
|
||||
current_event_ = std::make_unique<blink::WebMouseWheelEvent>(
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, dx, dy, 0,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel));
|
||||
0, 0, dx, dy, 0, ui::ScrollGranularity::kScrollByPrecisePixel));
|
||||
return controller_->WillHandleEvent(*current_event_);
|
||||
}
|
||||
|
||||
|
@ -1225,7 +1225,7 @@ void RenderWidgetHostInputEventRouter::SendGestureScrollBegin(
|
||||
scroll_begin.data.scroll_begin.delta_x_hint = 0;
|
||||
scroll_begin.data.scroll_begin.delta_y_hint = 0;
|
||||
scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_begin.data.scroll_begin.scrollable_area_element_id = 0;
|
||||
view->ProcessGestureEvent(
|
||||
scroll_begin,
|
||||
@ -1251,7 +1251,7 @@ void RenderWidgetHostInputEventRouter::SendGestureScrollEnd(
|
||||
scroll_end.data.scroll_end.inertial_phase =
|
||||
blink::WebGestureEvent::InertialPhaseState::kUnknownMomentum;
|
||||
scroll_end.data.scroll_end.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
break;
|
||||
default:
|
||||
NOTREACHED();
|
||||
@ -1270,7 +1270,7 @@ void RenderWidgetHostInputEventRouter::SendGestureScrollEnd(
|
||||
scroll_end.data.scroll_end.inertial_phase =
|
||||
blink::WebGestureEvent::InertialPhaseState::kUnknownMomentum;
|
||||
scroll_end.data.scroll_end.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
view->ProcessGestureEvent(
|
||||
scroll_end,
|
||||
ui::WebInputEventTraits::CreateLatencyInfoForWebGestureEvent(scroll_end));
|
||||
|
@ -606,8 +606,8 @@ class RenderWidgetHostTest : public testing::Test {
|
||||
void SimulateWheelEvent(float dX, float dY, int modifiers, bool precise) {
|
||||
host_->ForwardWheelEvent(SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, dX, dY, modifiers,
|
||||
precise ? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel));
|
||||
precise ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel));
|
||||
}
|
||||
|
||||
void SimulateWheelEvent(float dX,
|
||||
@ -617,8 +617,8 @@ class RenderWidgetHostTest : public testing::Test {
|
||||
WebMouseWheelEvent::Phase phase) {
|
||||
WebMouseWheelEvent wheel_event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, dX, dY, modifiers,
|
||||
precise ? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
precise ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel);
|
||||
wheel_event.phase = phase;
|
||||
host_->ForwardWheelEvent(wheel_event);
|
||||
}
|
||||
@ -631,8 +631,8 @@ class RenderWidgetHostTest : public testing::Test {
|
||||
host_->ForwardWheelEventWithLatencyInfo(
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, dX, dY, modifiers,
|
||||
precise ? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
precise ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel),
|
||||
ui_latency);
|
||||
}
|
||||
|
||||
@ -644,8 +644,8 @@ class RenderWidgetHostTest : public testing::Test {
|
||||
WebMouseWheelEvent::Phase phase) {
|
||||
WebMouseWheelEvent wheel_event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, dX, dY, modifiers,
|
||||
precise ? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
precise ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel);
|
||||
wheel_event.phase = phase;
|
||||
host_->ForwardWheelEventWithLatencyInfo(wheel_event, ui_latency);
|
||||
}
|
||||
|
@ -739,8 +739,8 @@ class RenderWidgetHostViewAuraOverscrollTest
|
||||
WebMouseWheelEvent::Phase phase) {
|
||||
WebMouseWheelEvent wheel_event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, dX, dY, modifiers,
|
||||
precise ? ui::input_types::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
precise ? ui::ScrollGranularity::kScrollByPrecisePixel
|
||||
: ui::ScrollGranularity::kScrollByPixel);
|
||||
wheel_event.phase = phase;
|
||||
widget_host_->ForwardWheelEvent(wheel_event);
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
@ -1553,7 +1553,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests(),
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_x_hint = 0.f;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_y_hint = 5.f;
|
||||
|
||||
@ -1565,7 +1565,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests(),
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_update.data.scroll_update.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_update.data.scroll_update.delta_x = 0.f;
|
||||
gesture_scroll_update.data.scroll_update.delta_y = 5.f;
|
||||
gesture_scroll_update.data.scroll_update.velocity_y = 5.f;
|
||||
@ -1665,8 +1665,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScrollBubblingFromOOPIFTest) {
|
||||
// Use precise pixels to keep these events off the animated scroll pathways,
|
||||
// which currently break this test.
|
||||
// https://bugs.chromium.org/p/chromium/issues/detail?id=710513
|
||||
scroll_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_x = 0.0f;
|
||||
scroll_event.delta_y = -5.0f;
|
||||
scroll_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
@ -1912,7 +1911,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests());
|
||||
gesture_scroll_begin.SetSourceDevice(blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_x_hint = 0.f;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_y_hint = 5.f;
|
||||
child_rwh->ForwardGestureEvent(gesture_scroll_begin);
|
||||
@ -1955,8 +1954,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, TouchpadGestureFlingStart) {
|
||||
blink::WebMouseWheelEvent scroll_event(
|
||||
blink::WebInputEvent::kMouseWheel, blink::WebInputEvent::kNoModifiers,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests());
|
||||
scroll_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_x = 0.0f;
|
||||
scroll_event.delta_y = 5.0f;
|
||||
scroll_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
@ -2083,8 +2081,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
|
||||
scale_factor),
|
||||
gfx::ToCeiledInt((bounds.y() - root_view->GetViewBounds().y() + 10) *
|
||||
scale_factor));
|
||||
scroll_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_x = 0.0f;
|
||||
scroll_event.delta_y = 5.0f;
|
||||
scroll_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
@ -2143,8 +2140,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
|
||||
scale_factor),
|
||||
gfx::ToCeiledInt((bounds.y() - root_view->GetViewBounds().y() + 10) *
|
||||
scale_factor));
|
||||
scroll_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_x = 0.0f;
|
||||
scroll_event.delta_y = -5.0f;
|
||||
scroll_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
@ -2221,8 +2217,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScrollLocalSubframeInOOPIF) {
|
||||
blink::WebInputEvent::kMouseWheel, blink::WebInputEvent::kNoModifiers,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests());
|
||||
scroll_event.SetPositionInWidget(90, 110);
|
||||
scroll_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_x = 0.0f;
|
||||
scroll_event.delta_y = -50.0f;
|
||||
scroll_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
@ -14456,8 +14451,7 @@ class ScrollingIntegrationTest : public SitePerProcessBrowserTest {
|
||||
params.gesture_source_type = source;
|
||||
params.anchor = gfx::PointF(point);
|
||||
params.distances.push_back(-distance);
|
||||
params.granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
params.granularity = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
|
||||
auto gesture = std::make_unique<SyntheticSmoothScrollGesture>(params);
|
||||
|
||||
|
@ -1158,8 +1158,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
gfx::ToCeiledInt((bounds.y() - root_view->GetViewBounds().y() + 5) *
|
||||
scale_factor));
|
||||
SetWebEventPositions(&scroll_event, position_in_widget, root_view);
|
||||
scroll_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_x = 0.0f;
|
||||
scroll_event.delta_y = 5.0f;
|
||||
scroll_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
@ -1351,7 +1350,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_begin.unique_touch_event_id = 2;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_x_hint = 0.f;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_y_hint = -5.f * scale_factor;
|
||||
gesture_scroll_begin.SetPositionInWidget(touch_start_point);
|
||||
@ -1363,7 +1362,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_update.unique_touch_event_id = 2;
|
||||
gesture_scroll_update.data.scroll_update.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_update.data.scroll_update.delta_x = 0.f;
|
||||
gesture_scroll_update.data.scroll_update.delta_y = -5.f * scale_factor;
|
||||
gesture_scroll_update.SetPositionInWidget(touch_start_point);
|
||||
@ -1421,7 +1420,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_end.unique_touch_event_id = 3;
|
||||
gesture_scroll_end.data.scroll_end.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_end.SetPositionInWidget(touch_move_point);
|
||||
|
||||
InputEventAckWaiter await_scroll_end_in_child(
|
||||
@ -1685,8 +1684,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
blink::WebInputEvent::kMouseWheel, blink::WebInputEvent::kNoModifiers,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests());
|
||||
SetWebEventPositions(&scroll_event, position_in_root, root_rwhv);
|
||||
scroll_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_x = 0.0f;
|
||||
scroll_event.delta_y = 5.0f;
|
||||
scroll_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
@ -2252,7 +2250,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_begin.unique_touch_event_id = 1;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_x_hint = 0.f;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_y_hint = 0.f;
|
||||
#if defined(USE_AURA)
|
||||
@ -2277,7 +2275,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_update.unique_touch_event_id = 1;
|
||||
gesture_scroll_update.data.scroll_update.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_update.data.scroll_update.delta_x = 0.f;
|
||||
gesture_scroll_update.data.scroll_update.delta_y = 0.f;
|
||||
#if defined(USE_AURA)
|
||||
@ -2318,7 +2316,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_end.unique_touch_event_id = 1;
|
||||
gesture_scroll_end.data.scroll_end.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
mock_overscroll_observer->Reset();
|
||||
router->RouteGestureEvent(rwhv_root, &gesture_scroll_end,
|
||||
ui::LatencyInfo(ui::SourceEventType::TOUCH));
|
||||
@ -4549,8 +4547,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelHitTestBrowserTest,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests());
|
||||
gfx::Point child_point_in_root(90, 90);
|
||||
SetWebEventPositions(&scroll_event, child_point_in_root, rwhv_root);
|
||||
scroll_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_x = 0.0f;
|
||||
scroll_event.delta_y = -20.0f;
|
||||
scroll_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
|
||||
|
@ -175,8 +175,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessMacBrowserTest,
|
||||
blink::WebInputEvent::kMouseWheel, blink::WebInputEvent::kNoModifiers,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests());
|
||||
scroll_event.SetPositionInWidget(1, 1);
|
||||
scroll_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
scroll_event.delta_x = 0.0f;
|
||||
|
||||
// Have the RWHVCF process a sequence of touchpad scroll events that contain
|
||||
|
@ -2890,8 +2890,7 @@ TEST_F(WebContentsImplTest, HandleWheelEvent) {
|
||||
int modifiers = 0;
|
||||
// Verify that normal mouse wheel events do nothing to change the zoom level.
|
||||
blink::WebMouseWheelEvent event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, 0, 1, modifiers,
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
0, 0, 0, 1, modifiers, ui::ScrollGranularity::kScrollByPixel);
|
||||
EXPECT_FALSE(contents()->HandleWheelEvent(event));
|
||||
EXPECT_EQ(0, delegate->GetAndResetContentsZoomChangedCallCount());
|
||||
|
||||
@ -2900,8 +2899,7 @@ TEST_F(WebContentsImplTest, HandleWheelEvent) {
|
||||
// with mousewheel.
|
||||
modifiers = WebInputEvent::kControlKey;
|
||||
event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, 0, 1, modifiers,
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
0, 0, 0, 1, modifiers, ui::ScrollGranularity::kScrollByPixel);
|
||||
bool handled = contents()->HandleWheelEvent(event);
|
||||
#if defined(USE_AURA)
|
||||
EXPECT_TRUE(handled);
|
||||
@ -2915,8 +2913,7 @@ TEST_F(WebContentsImplTest, HandleWheelEvent) {
|
||||
modifiers = WebInputEvent::kControlKey | WebInputEvent::kShiftKey |
|
||||
WebInputEvent::kAltKey;
|
||||
event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, 2, -5, modifiers,
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
0, 0, 2, -5, modifiers, ui::ScrollGranularity::kScrollByPixel);
|
||||
handled = contents()->HandleWheelEvent(event);
|
||||
#if defined(USE_AURA)
|
||||
EXPECT_TRUE(handled);
|
||||
@ -2929,8 +2926,7 @@ TEST_F(WebContentsImplTest, HandleWheelEvent) {
|
||||
|
||||
// Unless there is no vertical movement.
|
||||
event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, 2, 0, modifiers,
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
0, 0, 2, 0, modifiers, ui::ScrollGranularity::kScrollByPixel);
|
||||
EXPECT_FALSE(contents()->HandleWheelEvent(event));
|
||||
EXPECT_EQ(0, delegate->GetAndResetContentsZoomChangedCallCount());
|
||||
|
||||
@ -2939,8 +2935,7 @@ TEST_F(WebContentsImplTest, HandleWheelEvent) {
|
||||
// two-finger-scrolling on a touchpad.
|
||||
modifiers = WebInputEvent::kControlKey;
|
||||
event = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
0, 0, 0, 5, modifiers,
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
0, 0, 0, 5, modifiers, ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
EXPECT_FALSE(contents()->HandleWheelEvent(event));
|
||||
EXPECT_EQ(0, delegate->GetAndResetContentsZoomChangedCallCount());
|
||||
|
||||
|
@ -394,7 +394,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests(),
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_x_hint = 0.f;
|
||||
gesture_scroll_begin.data.scroll_begin.delta_y_hint = 0.f;
|
||||
GetRenderWidgetHost()->ForwardGestureEvent(gesture_scroll_begin);
|
||||
@ -405,7 +405,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests(),
|
||||
blink::WebGestureDevice::kTouchscreen);
|
||||
gesture_scroll_update.data.scroll_update.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
gesture_scroll_update.data.scroll_update.delta_y = 0.f;
|
||||
float start_threshold = OverscrollConfig::kStartTouchscreenThresholdDips;
|
||||
gesture_scroll_update.data.scroll_update.delta_x = start_threshold + 1;
|
||||
|
@ -343,8 +343,7 @@ bool StructTraits<content::mojom::EventDataView, InputEventUniquePtr>::Read(
|
||||
static_cast<blink::WebMouseWheelEvent::EventAction>(
|
||||
wheel_data->event_action);
|
||||
wheel_event->delta_units =
|
||||
static_cast<ui::input_types::ScrollGranularity>(
|
||||
wheel_data->delta_units);
|
||||
static_cast<ui::ScrollGranularity>(wheel_data->delta_units);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams()
|
||||
speed_in_pixels_s(kDefaultSpeedInPixelsS),
|
||||
fling_velocity_x(0),
|
||||
fling_velocity_y(0),
|
||||
granularity(ui::input_types::ScrollGranularity::kScrollByPixel) {}
|
||||
granularity(ui::ScrollGranularity::kScrollByPixel) {}
|
||||
|
||||
SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams(
|
||||
const SyntheticSmoothScrollGestureParams& other) = default;
|
||||
|
@ -31,7 +31,7 @@ struct CONTENT_EXPORT SyntheticSmoothScrollGestureParams
|
||||
float speed_in_pixels_s;
|
||||
float fling_velocity_x;
|
||||
float fling_velocity_y;
|
||||
ui::input_types::ScrollGranularity granularity;
|
||||
ui::ScrollGranularity granularity;
|
||||
|
||||
static const SyntheticSmoothScrollGestureParams* Cast(
|
||||
const SyntheticGestureParams* gesture_params);
|
||||
|
@ -58,7 +58,7 @@ WebMouseWheelEvent SyntheticWebMouseWheelEventBuilder::Build(
|
||||
float dx,
|
||||
float dy,
|
||||
int modifiers,
|
||||
ui::input_types::ScrollGranularity delta_units) {
|
||||
ui::ScrollGranularity delta_units) {
|
||||
return Build(x, y, 0, 0, dx, dy, modifiers, delta_units);
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ WebMouseWheelEvent SyntheticWebMouseWheelEventBuilder::Build(
|
||||
float dx,
|
||||
float dy,
|
||||
int modifiers,
|
||||
ui::input_types::ScrollGranularity delta_units) {
|
||||
ui::ScrollGranularity delta_units) {
|
||||
WebMouseWheelEvent result(WebInputEvent::kMouseWheel, modifiers,
|
||||
ui::EventTimeForNow());
|
||||
result.SetPositionInScreen(global_x, global_y);
|
||||
|
@ -34,22 +34,20 @@ class CONTENT_EXPORT SyntheticWebMouseWheelEventBuilder {
|
||||
public:
|
||||
static blink::WebMouseWheelEvent Build(
|
||||
blink::WebMouseWheelEvent::Phase phase);
|
||||
static blink::WebMouseWheelEvent Build(
|
||||
float x,
|
||||
float y,
|
||||
float dx,
|
||||
float dy,
|
||||
int modifiers,
|
||||
ui::input_types::ScrollGranularity delta_units);
|
||||
static blink::WebMouseWheelEvent Build(
|
||||
float x,
|
||||
float y,
|
||||
float global_x,
|
||||
float global_y,
|
||||
float dx,
|
||||
float dy,
|
||||
int modifiers,
|
||||
ui::input_types::ScrollGranularity delta_units);
|
||||
static blink::WebMouseWheelEvent Build(float x,
|
||||
float y,
|
||||
float dx,
|
||||
float dy,
|
||||
int modifiers,
|
||||
ui::ScrollGranularity delta_units);
|
||||
static blink::WebMouseWheelEvent Build(float x,
|
||||
float y,
|
||||
float global_x,
|
||||
float global_y,
|
||||
float dx,
|
||||
float dy,
|
||||
int modifiers,
|
||||
ui::ScrollGranularity delta_units);
|
||||
};
|
||||
|
||||
class CONTENT_EXPORT SyntheticWebKeyboardEventBuilder {
|
||||
|
@ -16,8 +16,7 @@ blink::WebMouseWheelEvent::EventAction WebMouseWheelEventTraits::GetEventAction(
|
||||
#if defined(USE_AURA)
|
||||
// Scroll events generated from the mouse wheel when the control key is held
|
||||
// don't trigger scrolling. Instead, they may cause zooming.
|
||||
if (event.delta_units !=
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel &&
|
||||
if (event.delta_units != ui::ScrollGranularity::kScrollByPrecisePixel &&
|
||||
(event.GetModifiers() & WebInputEvent::kControlKey)) {
|
||||
return blink::WebMouseWheelEvent::EventAction::kPageZoom;
|
||||
}
|
||||
|
@ -956,8 +956,7 @@ void SimulateMouseWheelCtrlZoomEvent(WebContents* web_contents,
|
||||
ui::EventTimeForNow());
|
||||
|
||||
wheel_event.SetPositionInWidget(point.x(), point.y());
|
||||
wheel_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
wheel_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
wheel_event.delta_y =
|
||||
(zoom_in ? 1.0 : -1.0) * ui::MouseWheelEvent::kWheelDelta;
|
||||
wheel_event.wheel_ticks_y = (zoom_in ? 1.0 : -1.0);
|
||||
|
@ -48,7 +48,7 @@ void FakeRemoteFrame::SetNeedsOcclusionTracking(bool needs_tracking) {}
|
||||
|
||||
void FakeRemoteFrame::BubbleLogicalScroll(
|
||||
blink::mojom::ScrollDirection direction,
|
||||
ui::input_types::ScrollGranularity granularity) {}
|
||||
ui::ScrollGranularity granularity) {}
|
||||
|
||||
void FakeRemoteFrame::UpdateUserActivationState(
|
||||
blink::mojom::UserActivationUpdateType) {}
|
||||
|
@ -52,9 +52,8 @@ class FakeRemoteFrame : public blink::mojom::RemoteFrame {
|
||||
void Focus() override;
|
||||
void SetHadStickyUserActivationBeforeNavigation(bool value) override;
|
||||
void SetNeedsOcclusionTracking(bool needs_tracking) override;
|
||||
void BubbleLogicalScroll(
|
||||
blink::mojom::ScrollDirection direction,
|
||||
ui::input_types::ScrollGranularity granularity) override;
|
||||
void BubbleLogicalScroll(blink::mojom::ScrollDirection direction,
|
||||
ui::ScrollGranularity granularity) override;
|
||||
void UpdateUserActivationState(
|
||||
blink::mojom::UserActivationUpdateType) override;
|
||||
void SetEmbeddingToken(
|
||||
|
@ -339,19 +339,14 @@ bool BeginSmoothScroll(GpuBenchmarkingContext* context,
|
||||
gesture_params.speed_in_pixels_s = speed_in_pixels_s;
|
||||
gesture_params.prevent_fling = prevent_fling;
|
||||
|
||||
if (scroll_by_page) {
|
||||
gesture_params.granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
} else if (precise_scrolling_deltas) {
|
||||
gesture_params.granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
} else if (scroll_by_percentage) {
|
||||
gesture_params.granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage;
|
||||
} else {
|
||||
gesture_params.granularity =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
}
|
||||
if (scroll_by_page)
|
||||
gesture_params.granularity = ui::ScrollGranularity::kScrollByPage;
|
||||
else if (precise_scrolling_deltas)
|
||||
gesture_params.granularity = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
else if (scroll_by_percentage)
|
||||
gesture_params.granularity = ui::ScrollGranularity::kScrollByPercentage;
|
||||
else
|
||||
gesture_params.granularity = ui::ScrollGranularity::kScrollByPixel;
|
||||
|
||||
gesture_params.anchor.SetPoint(start_x, start_y);
|
||||
|
||||
|
@ -301,7 +301,7 @@ TEST_F(MainThreadEventQueueTest, ClientDoesntHandleInputEvent) {
|
||||
event.PressPoint(10, 10);
|
||||
event.MovePoint(0, 20, 20);
|
||||
WebMouseWheelEvent event2 = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
10, 10, 0, 53, 0, ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
10, 10, 0, 53, 0, ui::ScrollGranularity::kScrollByPixel);
|
||||
HandleEvent(event2, INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
|
||||
RunPendingTasksWithSimulatedRaf();
|
||||
|
||||
@ -322,13 +322,13 @@ TEST_F(MainThreadEventQueueTest, ClientDoesntHandleInputEvent) {
|
||||
TEST_F(MainThreadEventQueueTest, NonBlockingWheel) {
|
||||
WebMouseWheelEvent kEvents[4] = {
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
10, 10, 0, 53, 0, ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
10, 10, 0, 53, 0, ui::ScrollGranularity::kScrollByPixel),
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
20, 20, 0, 53, 0, ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
20, 20, 0, 53, 0, ui::ScrollGranularity::kScrollByPixel),
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
30, 30, 0, 53, 1, ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
30, 30, 0, 53, 1, ui::ScrollGranularity::kScrollByPixel),
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
30, 30, 0, 53, 1, ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
30, 30, 0, 53, 1, ui::ScrollGranularity::kScrollByPixel),
|
||||
};
|
||||
|
||||
EXPECT_FALSE(main_task_runner_->HasPendingTask());
|
||||
@ -563,9 +563,9 @@ TEST_F(MainThreadEventQueueTest, BlockingTouch) {
|
||||
TEST_F(MainThreadEventQueueTest, InterleavedEvents) {
|
||||
WebMouseWheelEvent kWheelEvents[2] = {
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
10, 10, 0, 53, 0, ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
10, 10, 0, 53, 0, ui::ScrollGranularity::kScrollByPixel),
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
20, 20, 0, 53, 0, ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
20, 20, 0, 53, 0, ui::ScrollGranularity::kScrollByPixel),
|
||||
};
|
||||
SyntheticWebTouchEvent kTouchEvents[2];
|
||||
kTouchEvents[0].PressPoint(10, 10);
|
||||
@ -633,11 +633,11 @@ TEST_F(MainThreadEventQueueTest, RafAlignedMouseInput) {
|
||||
|
||||
WebMouseWheelEvent wheelEvents[3] = {
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
10, 10, 0, 53, 0, ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
10, 10, 0, 53, 0, ui::ScrollGranularity::kScrollByPixel),
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
20, 20, 0, 53, 0, ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
20, 20, 0, 53, 0, ui::ScrollGranularity::kScrollByPixel),
|
||||
SyntheticWebMouseWheelEventBuilder::Build(
|
||||
20, 20, 0, 53, 1, ui::input_types::ScrollGranularity::kScrollByPixel),
|
||||
20, 20, 0, 53, 1, ui::ScrollGranularity::kScrollByPixel),
|
||||
};
|
||||
|
||||
EXPECT_FALSE(main_task_runner_->HasPendingTask());
|
||||
@ -927,7 +927,7 @@ TEST_F(MainThreadEventQueueTest, LowLatency) {
|
||||
WebMouseEvent mouse_move = SyntheticWebMouseEventBuilder::Build(
|
||||
WebInputEvent::kMouseMove, 10, 10, 0);
|
||||
WebMouseWheelEvent mouse_wheel = SyntheticWebMouseWheelEventBuilder::Build(
|
||||
10, 10, 0, 53, 0, ui::input_types::ScrollGranularity::kScrollByPixel);
|
||||
10, 10, 0, 53, 0, ui::ScrollGranularity::kScrollByPixel);
|
||||
|
||||
HandleEvent(mouse_move, INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING);
|
||||
HandleEvent(mouse_wheel, INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING);
|
||||
|
@ -559,7 +559,7 @@ void RenderWidgetInputHandler::DidOverscrollFromBlink(
|
||||
void RenderWidgetInputHandler::InjectGestureScrollEvent(
|
||||
blink::WebGestureDevice device,
|
||||
const gfx::Vector2dF& delta,
|
||||
ui::input_types::ScrollGranularity granularity,
|
||||
ui::ScrollGranularity granularity,
|
||||
cc::ElementId scrollable_area_element_id,
|
||||
WebInputEvent::Type injected_type) {
|
||||
DCHECK(ui::IsGestureScroll(injected_type));
|
||||
|
@ -66,7 +66,7 @@ class CONTENT_EXPORT RenderWidgetInputHandler {
|
||||
|
||||
void InjectGestureScrollEvent(blink::WebGestureDevice device,
|
||||
const gfx::Vector2dF& delta,
|
||||
ui::input_types::ScrollGranularity granularity,
|
||||
ui::ScrollGranularity granularity,
|
||||
cc::ElementId scrollable_area_element_id,
|
||||
blink::WebInputEvent::Type injected_type);
|
||||
|
||||
@ -88,7 +88,7 @@ class CONTENT_EXPORT RenderWidgetInputHandler {
|
||||
struct InjectScrollGestureParams {
|
||||
blink::WebGestureDevice device;
|
||||
gfx::Vector2dF scroll_delta;
|
||||
ui::input_types::ScrollGranularity granularity;
|
||||
ui::ScrollGranularity granularity;
|
||||
cc::ElementId scrollable_area_element_id;
|
||||
blink::WebInputEvent::Type type;
|
||||
};
|
||||
|
@ -276,8 +276,7 @@ void AppendMouseWheelEvent(const WebInputEvent& event,
|
||||
result.wheel_ticks.x = mouse_wheel_event.wheel_ticks_x;
|
||||
result.wheel_ticks.y = mouse_wheel_event.wheel_ticks_y;
|
||||
result.wheel_scroll_by_page =
|
||||
(mouse_wheel_event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPage);
|
||||
(mouse_wheel_event.delta_units == ui::ScrollGranularity::kScrollByPage);
|
||||
result_events->push_back(result);
|
||||
}
|
||||
|
||||
@ -532,10 +531,9 @@ WebMouseWheelEvent* BuildMouseWheelEvent(const InputEventData& event) {
|
||||
mouse_wheel_event->delta_y = event.wheel_delta.y;
|
||||
mouse_wheel_event->wheel_ticks_x = event.wheel_ticks.x;
|
||||
mouse_wheel_event->wheel_ticks_y = event.wheel_ticks.y;
|
||||
mouse_wheel_event->delta_units =
|
||||
event.wheel_scroll_by_page
|
||||
? ui::input_types::ScrollGranularity::kScrollByPage
|
||||
: ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
mouse_wheel_event->delta_units = event.wheel_scroll_by_page
|
||||
? ui::ScrollGranularity::kScrollByPage
|
||||
: ui::ScrollGranularity::kScrollByPixel;
|
||||
return mouse_wheel_event;
|
||||
}
|
||||
|
||||
|
@ -2763,7 +2763,7 @@ void RenderWidget::DidOverscroll(const gfx::Vector2dF& overscroll_delta,
|
||||
void RenderWidget::InjectGestureScrollEvent(
|
||||
blink::WebGestureDevice device,
|
||||
const gfx::Vector2dF& delta,
|
||||
ui::input_types::ScrollGranularity granularity,
|
||||
ui::ScrollGranularity granularity,
|
||||
cc::ElementId scrollable_area_element_id,
|
||||
blink::WebInputEvent::Type injected_type) {
|
||||
input_handler_->InjectGestureScrollEvent(
|
||||
|
@ -400,7 +400,7 @@ class CONTENT_EXPORT RenderWidget
|
||||
void InjectGestureScrollEvent(
|
||||
blink::WebGestureDevice device,
|
||||
const gfx::Vector2dF& delta,
|
||||
ui::input_types::ScrollGranularity granularity,
|
||||
ui::ScrollGranularity granularity,
|
||||
cc::ElementId scrollable_area_element_id,
|
||||
blink::WebInputEvent::Type injected_type) override;
|
||||
void SetOverscrollBehavior(const cc::OverscrollBehavior&) override;
|
||||
|
@ -543,27 +543,26 @@ bool IsSystemKeyEvent(const WebKeyboardEvent& event) {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GetScrollUnits(gin::Arguments* args,
|
||||
ui::input_types::ScrollGranularity* units) {
|
||||
bool GetScrollUnits(gin::Arguments* args, ui::ScrollGranularity* units) {
|
||||
std::string units_string;
|
||||
if (!args->PeekNext().IsEmpty()) {
|
||||
if (args->PeekNext()->IsString())
|
||||
args->GetNext(&units_string);
|
||||
if (units_string == "Page") {
|
||||
*units = ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
*units = ui::ScrollGranularity::kScrollByPage;
|
||||
return true;
|
||||
} else if (units_string == "Pixels") {
|
||||
*units = ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
*units = ui::ScrollGranularity::kScrollByPixel;
|
||||
return true;
|
||||
} else if (units_string == "PrecisePixels") {
|
||||
*units = ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
*units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
return true;
|
||||
} else {
|
||||
args->ThrowError();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
*units = ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
*units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -2578,12 +2577,11 @@ WebMouseWheelEvent EventSender::GetMouseWheelEvent(gin::Arguments* args,
|
||||
event.delta_x = event.wheel_ticks_x;
|
||||
event.delta_y = event.wheel_ticks_y;
|
||||
if (paged) {
|
||||
event.delta_units = ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
event.delta_units = ui::ScrollGranularity::kScrollByPage;
|
||||
} else if (has_precise_scrolling_deltas) {
|
||||
event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
} else {
|
||||
event.delta_units = ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
event.delta_units = ui::ScrollGranularity::kScrollByPixel;
|
||||
}
|
||||
event.phase = phase;
|
||||
if (scroll_type == MouseScrollType::PIXEL) {
|
||||
@ -2805,8 +2803,7 @@ void EventSender::SendGesturesForMouseWheelEvent(
|
||||
begin_event.data.scroll_begin.delta_x_hint = wheel_event.delta_x;
|
||||
begin_event.data.scroll_begin.delta_y_hint = wheel_event.delta_y;
|
||||
begin_event.data.scroll_begin.delta_hint_units = wheel_event.delta_units;
|
||||
if (wheel_event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPage) {
|
||||
if (wheel_event.delta_units == ui::ScrollGranularity::kScrollByPage) {
|
||||
if (begin_event.data.scroll_begin.delta_x_hint) {
|
||||
begin_event.data.scroll_begin.delta_x_hint =
|
||||
begin_event.data.scroll_begin.delta_x_hint > 0 ? 1 : -1;
|
||||
|
@ -15,12 +15,11 @@ float WebGestureEvent::DeltaXInRootFrame() const {
|
||||
? data.scroll_begin.delta_x_hint
|
||||
: data.scroll_update.delta_x;
|
||||
|
||||
bool is_percent =
|
||||
(type_ == WebInputEvent::kGestureScrollBegin)
|
||||
? data.scroll_begin.delta_hint_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage
|
||||
: data.scroll_update.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage;
|
||||
bool is_percent = (type_ == WebInputEvent::kGestureScrollBegin)
|
||||
? data.scroll_begin.delta_hint_units ==
|
||||
ui::ScrollGranularity::kScrollByPercentage
|
||||
: data.scroll_update.delta_units ==
|
||||
ui::ScrollGranularity::kScrollByPercentage;
|
||||
|
||||
return is_percent ? delta_x : delta_x / frame_scale_;
|
||||
}
|
||||
@ -30,17 +29,16 @@ float WebGestureEvent::DeltaYInRootFrame() const {
|
||||
? data.scroll_begin.delta_y_hint
|
||||
: data.scroll_update.delta_y;
|
||||
|
||||
bool is_percent =
|
||||
(type_ == WebInputEvent::kGestureScrollBegin)
|
||||
? data.scroll_begin.delta_hint_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage
|
||||
: data.scroll_update.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage;
|
||||
bool is_percent = (type_ == WebInputEvent::kGestureScrollBegin)
|
||||
? data.scroll_begin.delta_hint_units ==
|
||||
ui::ScrollGranularity::kScrollByPercentage
|
||||
: data.scroll_update.delta_units ==
|
||||
ui::ScrollGranularity::kScrollByPercentage;
|
||||
|
||||
return is_percent ? delta_y : delta_y / frame_scale_;
|
||||
}
|
||||
|
||||
ui::input_types::ScrollGranularity WebGestureEvent::DeltaUnits() const {
|
||||
ui::ScrollGranularity WebGestureEvent::DeltaUnits() const {
|
||||
if (type_ == WebInputEvent::kGestureScrollBegin)
|
||||
return data.scroll_begin.delta_hint_units;
|
||||
if (type_ == WebInputEvent::kGestureScrollUpdate)
|
||||
@ -130,14 +128,14 @@ void WebGestureEvent::FlattenTransform() {
|
||||
switch (type_) {
|
||||
case WebInputEvent::kGestureScrollBegin:
|
||||
if (data.scroll_begin.delta_hint_units !=
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage) {
|
||||
ui::ScrollGranularity::kScrollByPercentage) {
|
||||
data.scroll_begin.delta_x_hint /= frame_scale_;
|
||||
data.scroll_begin.delta_y_hint /= frame_scale_;
|
||||
}
|
||||
break;
|
||||
case WebInputEvent::kGestureScrollUpdate:
|
||||
if (data.scroll_update.delta_units !=
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage) {
|
||||
ui::ScrollGranularity::kScrollByPercentage) {
|
||||
data.scroll_update.delta_x /= frame_scale_;
|
||||
data.scroll_update.delta_y /= frame_scale_;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ class BLINK_COMMON_EXPORT WebGestureEvent : public WebInputEvent {
|
||||
// number of pointers down.
|
||||
int pointer_count;
|
||||
// Default initialized to kScrollByPrecisePixel.
|
||||
ui::input_types::ScrollGranularity delta_hint_units;
|
||||
ui::ScrollGranularity delta_hint_units;
|
||||
// The state of inertial phase scrolling. OSX has unique phases for normal
|
||||
// and momentum scroll events. Should always be kUnknownMomentumPhase for
|
||||
// touch based input as it generates GestureFlingStart instead.
|
||||
@ -106,13 +106,13 @@ class BLINK_COMMON_EXPORT WebGestureEvent : public WebInputEvent {
|
||||
float velocity_y;
|
||||
InertialPhaseState inertial_phase;
|
||||
// Default initialized to kScrollByPrecisePixel.
|
||||
ui::input_types::ScrollGranularity delta_units;
|
||||
ui::ScrollGranularity delta_units;
|
||||
} scroll_update;
|
||||
|
||||
struct {
|
||||
// The original delta units the ScrollBegin and ScrollUpdates
|
||||
// were sent as.
|
||||
ui::input_types::ScrollGranularity delta_units;
|
||||
ui::ScrollGranularity delta_units;
|
||||
// The state of inertial phase scrolling. OSX has unique phases for normal
|
||||
// and momentum scroll events. Should always be kUnknownMomentumPhase for
|
||||
// touch based input as it generates GestureFlingStart instead.
|
||||
@ -211,7 +211,7 @@ class BLINK_COMMON_EXPORT WebGestureEvent : public WebInputEvent {
|
||||
|
||||
float DeltaXInRootFrame() const;
|
||||
float DeltaYInRootFrame() const;
|
||||
ui::input_types::ScrollGranularity DeltaUnits() const;
|
||||
ui::ScrollGranularity DeltaUnits() const;
|
||||
gfx::PointF PositionInRootFrame() const;
|
||||
InertialPhaseState InertialPhase() const;
|
||||
bool Synthetic() const;
|
||||
|
@ -80,8 +80,7 @@ class BLINK_COMMON_EXPORT WebMouseWheelEvent : public WebMouseEvent {
|
||||
// kScrollByPrecisePixel, kScrollByPixel, and kScrollByPage, as they are
|
||||
// the only values expected after converting an OS event to a
|
||||
// WebMouseWheelEvent.
|
||||
ui::input_types::ScrollGranularity delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
ui::ScrollGranularity delta_units = ui::ScrollGranularity::kScrollByPixel;
|
||||
|
||||
WebMouseWheelEvent(Type type, int modifiers, base::TimeTicks time_stamp)
|
||||
: WebMouseEvent(type, modifiers, time_stamp, kMousePointerId) {}
|
||||
|
@ -186,7 +186,7 @@ class WebWidgetClient {
|
||||
virtual void InjectGestureScrollEvent(
|
||||
WebGestureDevice device,
|
||||
const gfx::Vector2dF& delta,
|
||||
ui::input_types::ScrollGranularity granularity,
|
||||
ui::ScrollGranularity granularity,
|
||||
cc::ElementId scrollable_area_element_id,
|
||||
WebInputEvent::Type injected_type) {}
|
||||
|
||||
|
@ -38,12 +38,10 @@ namespace {
|
||||
|
||||
unsigned ConvertDeltaMode(const WebMouseWheelEvent& event) {
|
||||
// WebMouseWheelEvent only supports these units for the delta.
|
||||
DCHECK(
|
||||
event.delta_units == ui::input_types::ScrollGranularity::kScrollByPage ||
|
||||
event.delta_units == ui::input_types::ScrollGranularity::kScrollByPixel ||
|
||||
event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
return event.delta_units == ui::input_types::ScrollGranularity::kScrollByPage
|
||||
DCHECK(event.delta_units == ui::ScrollGranularity::kScrollByPage ||
|
||||
event.delta_units == ui::ScrollGranularity::kScrollByPixel ||
|
||||
event.delta_units == ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
return event.delta_units == ui::ScrollGranularity::kScrollByPage
|
||||
? WheelEvent::kDomDeltaPage
|
||||
: WheelEvent::kDomDeltaPixel;
|
||||
}
|
||||
|
@ -425,9 +425,8 @@ void RemoteFrame::SetNeedsOcclusionTracking(bool needs_tracking) {
|
||||
View()->SetNeedsOcclusionTracking(needs_tracking);
|
||||
}
|
||||
|
||||
void RemoteFrame::BubbleLogicalScroll(
|
||||
mojom::blink::ScrollDirection direction,
|
||||
ui::input_types::ScrollGranularity granularity) {
|
||||
void RemoteFrame::BubbleLogicalScroll(mojom::blink::ScrollDirection direction,
|
||||
ui::ScrollGranularity granularity) {
|
||||
Frame* parent_frame = Client()->Parent();
|
||||
DCHECK(parent_frame);
|
||||
DCHECK(parent_frame->IsLocalFrame());
|
||||
|
@ -109,9 +109,8 @@ class CORE_EXPORT RemoteFrame final : public Frame,
|
||||
void Focus() override;
|
||||
void SetHadStickyUserActivationBeforeNavigation(bool value) override;
|
||||
void SetNeedsOcclusionTracking(bool needs_tracking) override;
|
||||
void BubbleLogicalScroll(
|
||||
mojom::blink::ScrollDirection direction,
|
||||
ui::input_types::ScrollGranularity granularity) override;
|
||||
void BubbleLogicalScroll(mojom::blink::ScrollDirection direction,
|
||||
ui::ScrollGranularity granularity) override;
|
||||
void UpdateUserActivationState(
|
||||
mojom::blink::UserActivationUpdateType) override;
|
||||
void SetEmbeddingToken(
|
||||
|
@ -26,8 +26,7 @@ namespace {
|
||||
|
||||
gfx::Vector2dF ResolveMouseWheelPercentToWheelDelta(
|
||||
const WebMouseWheelEvent& event) {
|
||||
DCHECK(event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage);
|
||||
DCHECK(event.delta_units == ui::ScrollGranularity::kScrollByPercentage);
|
||||
// TODO (dlibby): OS scroll settings need to be factored into this.
|
||||
// Note that this value is negative because we're converting from wheel
|
||||
// ticks to wheel delta pixel. Wheel ticks are negative for scrolling down,
|
||||
@ -104,8 +103,7 @@ WebInputEventResult MouseWheelEventManager::HandleWheelEvent(
|
||||
|
||||
if (wheel_target_) {
|
||||
WheelEvent* dom_event =
|
||||
(event.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage)
|
||||
(event.delta_units == ui::ScrollGranularity::kScrollByPercentage)
|
||||
? WheelEvent::Create(event,
|
||||
ResolveMouseWheelPercentToWheelDelta(event),
|
||||
wheel_target_->GetDocument().domWindow())
|
||||
|
@ -505,7 +505,7 @@ WebInputEventResult ScrollManager::HandleGestureScrollBegin(
|
||||
|
||||
if (gesture_event.SourceDevice() == WebGestureDevice::kTouchpad &&
|
||||
gesture_event.data.scroll_begin.delta_hint_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
UseCounter::Count(document, WebFeature::kScrollByPrecisionTouchPad);
|
||||
} else if (gesture_event.SourceDevice() == WebGestureDevice::kTouchscreen) {
|
||||
UseCounter::Count(document, WebFeature::kScrollByTouch);
|
||||
|
@ -51,7 +51,7 @@ class CORE_EXPORT ScrollState final : public ScriptWrappable {
|
||||
double deltaGranularity() const {
|
||||
return static_cast<double>(data_->delta_granularity);
|
||||
}
|
||||
ui::input_types::ScrollGranularity delta_granularity() const {
|
||||
ui::ScrollGranularity delta_granularity() const {
|
||||
return data_->delta_granularity;
|
||||
}
|
||||
// Positive if moving right.
|
||||
|
@ -50,7 +50,7 @@ inline ScrollOffset ToScrollOffset(const gfx::PointF& p) {
|
||||
return ScrollOffset(p.x(), p.y());
|
||||
}
|
||||
|
||||
using ui::input_types::ScrollGranularity;
|
||||
using ui::ScrollGranularity;
|
||||
|
||||
enum ScrollDirectionPhysical {
|
||||
kScrollUp,
|
||||
|
@ -78,7 +78,7 @@ void FakeLocalFrameHost::ScrollRectToVisibleInParentFrame(
|
||||
|
||||
void FakeLocalFrameHost::BubbleLogicalScrollInParentFrame(
|
||||
blink::mojom::blink::ScrollDirection direction,
|
||||
ui::input_types::ScrollGranularity granularity) {}
|
||||
ui::ScrollGranularity granularity) {}
|
||||
|
||||
void FakeLocalFrameHost::DidAccessInitialDocument() {}
|
||||
|
||||
|
@ -56,7 +56,7 @@ class FakeLocalFrameHost : public mojom::blink::LocalFrameHost {
|
||||
blink::mojom::blink::ScrollIntoViewParamsPtr params) override;
|
||||
void BubbleLogicalScrollInParentFrame(
|
||||
blink::mojom::blink::ScrollDirection direction,
|
||||
ui::input_types::ScrollGranularity granularity) override;
|
||||
ui::ScrollGranularity granularity) override;
|
||||
void DidAccessInitialDocument() override;
|
||||
void DidBlockNavigation(const KURL& blocked_url,
|
||||
const KURL& initiator_url,
|
||||
|
@ -316,7 +316,7 @@ _CONFIG = [
|
||||
'cc::TargetSnapAreaElementIds',
|
||||
'gfx::RectToSkRect',
|
||||
'gfx::ScrollOffset',
|
||||
'ui::input_types::ScrollGranularity',
|
||||
'ui::ScrollGranularity',
|
||||
|
||||
# base/util/type_safety/strong_alias.h
|
||||
'util::StrongAlias',
|
||||
@ -482,8 +482,7 @@ _CONFIG = [
|
||||
},
|
||||
{
|
||||
'paths': [
|
||||
'third_party/blink/renderer/core/animation_frame',
|
||||
'third_party/blink/renderer/core/offscreencanvas',
|
||||
'third_party/blink/renderer/core/animation_frame', 'third_party/blink/renderer/core/offscreencanvas',
|
||||
'third_party/blink/renderer/core/html/canvas'
|
||||
],
|
||||
'allowed': [
|
||||
|
@ -870,10 +870,9 @@ std::unique_ptr<blink::WebInputEvent> TranslateAndScaleWebInputEvent(
|
||||
float x = (wheel_event->PositionInWidget().x() + delta.x()) * scale;
|
||||
float y = (wheel_event->PositionInWidget().y() + delta.y()) * scale;
|
||||
wheel_event->SetPositionInWidget(x, y);
|
||||
if (wheel_event->delta_units !=
|
||||
ui::input_types::ScrollGranularity::kScrollByPage &&
|
||||
if (wheel_event->delta_units != ui::ScrollGranularity::kScrollByPage &&
|
||||
wheel_event->delta_units !=
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage) {
|
||||
ui::ScrollGranularity::kScrollByPercentage) {
|
||||
wheel_event->delta_x *= scale;
|
||||
wheel_event->delta_y *= scale;
|
||||
wheel_event->wheel_ticks_x *= scale;
|
||||
@ -912,18 +911,18 @@ std::unique_ptr<blink::WebInputEvent> TranslateAndScaleWebInputEvent(
|
||||
switch (gesture_event->GetType()) {
|
||||
case blink::WebInputEvent::kGestureScrollUpdate:
|
||||
if (gesture_event->data.scroll_update.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel ||
|
||||
ui::ScrollGranularity::kScrollByPixel ||
|
||||
gesture_event->data.scroll_update.delta_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
gesture_event->data.scroll_update.delta_x *= scale;
|
||||
gesture_event->data.scroll_update.delta_y *= scale;
|
||||
}
|
||||
break;
|
||||
case blink::WebInputEvent::kGestureScrollBegin:
|
||||
if (gesture_event->data.scroll_begin.delta_hint_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPixel ||
|
||||
ui::ScrollGranularity::kScrollByPixel ||
|
||||
gesture_event->data.scroll_begin.delta_hint_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel) {
|
||||
gesture_event->data.scroll_begin.delta_x_hint *= scale;
|
||||
gesture_event->data.scroll_begin.delta_y_hint *= scale;
|
||||
}
|
||||
@ -1249,7 +1248,7 @@ std::unique_ptr<blink::WebGestureEvent> GenerateInjectedScrollGesture(
|
||||
blink::WebGestureDevice device,
|
||||
gfx::PointF position_in_widget,
|
||||
gfx::Vector2dF scroll_delta,
|
||||
input_types::ScrollGranularity granularity) {
|
||||
ScrollGranularity granularity) {
|
||||
DCHECK(IsGestureScroll(type));
|
||||
std::unique_ptr<WebGestureEvent> generated_gesture_event =
|
||||
std::make_unique<WebGestureEvent>(type, WebInputEvent::kNoModifiers,
|
||||
|
@ -124,7 +124,7 @@ std::unique_ptr<blink::WebGestureEvent> GenerateInjectedScrollGesture(
|
||||
blink::WebGestureDevice device,
|
||||
gfx::PointF position_in_widget,
|
||||
gfx::Vector2dF scroll_delta,
|
||||
input_types::ScrollGranularity granularity);
|
||||
ScrollGranularity granularity);
|
||||
|
||||
// Returns the position in the widget if it exists for the passed in event type
|
||||
gfx::PointF PositionInWidgetFromInputEvent(const blink::WebInputEvent& event);
|
||||
|
@ -67,7 +67,7 @@ TEST(BlinkEventUtilTest, NonPaginatedWebMouseWheelEvent) {
|
||||
blink::WebMouseWheelEvent event(
|
||||
blink::WebInputEvent::kMouseWheel, blink::WebInputEvent::kNoModifiers,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests());
|
||||
event.delta_units = ui::input_types::ScrollGranularity::kScrollByPixel;
|
||||
event.delta_units = ui::ScrollGranularity::kScrollByPixel;
|
||||
event.delta_x = 1.f;
|
||||
event.delta_y = 1.f;
|
||||
event.wheel_ticks_x = 1.f;
|
||||
@ -87,7 +87,7 @@ TEST(BlinkEventUtilTest, PaginatedWebMouseWheelEvent) {
|
||||
blink::WebMouseWheelEvent event(
|
||||
blink::WebInputEvent::kMouseWheel, blink::WebInputEvent::kNoModifiers,
|
||||
blink::WebInputEvent::GetStaticTimeStampForTests());
|
||||
event.delta_units = ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
event.delta_units = ui::ScrollGranularity::kScrollByPage;
|
||||
event.delta_x = 1.f;
|
||||
event.delta_y = 1.f;
|
||||
event.wheel_ticks_x = 1.f;
|
||||
@ -119,9 +119,8 @@ TEST(BlinkEventUtilTest, NonPaginatedScrollBeginEvent) {
|
||||
}
|
||||
|
||||
TEST(BlinkEventUtilTest, PaginatedScrollBeginEvent) {
|
||||
ui::GestureEventDetails details(
|
||||
ui::ET_GESTURE_SCROLL_BEGIN, 1, 1,
|
||||
ui::input_types::ScrollGranularity::kScrollByPage);
|
||||
ui::GestureEventDetails details(ui::ET_GESTURE_SCROLL_BEGIN, 1, 1,
|
||||
ui::ScrollGranularity::kScrollByPage);
|
||||
details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN);
|
||||
auto event =
|
||||
CreateWebGestureEvent(details, base::TimeTicks(), gfx::PointF(1.f, 1.f),
|
||||
@ -151,9 +150,8 @@ TEST(BlinkEventUtilTest, NonPaginatedScrollUpdateEvent) {
|
||||
}
|
||||
|
||||
TEST(BlinkEventUtilTest, PaginatedScrollUpdateEvent) {
|
||||
ui::GestureEventDetails details(
|
||||
ui::ET_GESTURE_SCROLL_UPDATE, 1, 1,
|
||||
ui::input_types::ScrollGranularity::kScrollByPage);
|
||||
ui::GestureEventDetails details(ui::ET_GESTURE_SCROLL_UPDATE, 1, 1,
|
||||
ui::ScrollGranularity::kScrollByPage);
|
||||
details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN);
|
||||
auto event =
|
||||
CreateWebGestureEvent(details, base::TimeTicks(), gfx::PointF(1.f, 1.f),
|
||||
@ -173,15 +171,15 @@ TEST(BlinkEventUtilTest, LineAndDocumentScrollEvents) {
|
||||
ui::ET_GESTURE_SCROLL_UPDATE,
|
||||
};
|
||||
|
||||
static const ui::input_types::ScrollGranularity units[] = {
|
||||
ui::input_types::ScrollGranularity::kScrollByLine,
|
||||
ui::input_types::ScrollGranularity::kScrollByDocument,
|
||||
static const ui::ScrollGranularity units[] = {
|
||||
ui::ScrollGranularity::kScrollByLine,
|
||||
ui::ScrollGranularity::kScrollByDocument,
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < base::size(types); i++) {
|
||||
ui::EventType type = types[i];
|
||||
for (size_t j = 0; j < base::size(units); j++) {
|
||||
ui::input_types::ScrollGranularity unit = units[j];
|
||||
ui::ScrollGranularity unit = units[j];
|
||||
ui::GestureEventDetails details(type, 1, 1, unit);
|
||||
details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN);
|
||||
auto event = CreateWebGestureEvent(details, base::TimeTicks(),
|
||||
|
@ -58,7 +58,7 @@ class FlingBoosterTest : public testing::Test {
|
||||
scroll_begin.data.scroll_begin.delta_x_hint = delta.x();
|
||||
scroll_begin.data.scroll_begin.delta_y_hint = delta.y();
|
||||
scroll_begin.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
return scroll_begin;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ class FlingBoosterTest : public testing::Test {
|
||||
scroll_update.data.scroll_update.delta_x = delta.x();
|
||||
scroll_update.data.scroll_update.delta_y = delta.y();
|
||||
scroll_update.data.scroll_update.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
return scroll_update;
|
||||
}
|
||||
|
||||
|
@ -819,7 +819,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin(
|
||||
cc::ElementId(element_id_type));
|
||||
}
|
||||
if (gesture_event.data.scroll_begin.delta_hint_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPage) {
|
||||
ui::ScrollGranularity::kScrollByPage) {
|
||||
scroll_status.thread = cc::InputHandler::SCROLL_ON_MAIN_THREAD;
|
||||
scroll_status.main_thread_scrolling_reasons =
|
||||
cc::MainThreadScrollingReason::kContinuingMainThreadScroll;
|
||||
|
@ -733,7 +733,7 @@ TEST_P(InputHandlerProxyTest, GestureScrollByPage) {
|
||||
|
||||
gesture_.SetType(WebInputEvent::kGestureScrollBegin);
|
||||
gesture_.data.scroll_begin.delta_hint_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
ui::ScrollGranularity::kScrollByPage;
|
||||
EXPECT_EQ(expected_disposition_,
|
||||
input_handler_->RouteToTypeSpecificHandler(gesture_));
|
||||
|
||||
@ -742,7 +742,7 @@ TEST_P(InputHandlerProxyTest, GestureScrollByPage) {
|
||||
gesture_.SetType(WebInputEvent::kGestureScrollUpdate);
|
||||
gesture_.data.scroll_update.delta_y = 1;
|
||||
gesture_.data.scroll_update.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
ui::ScrollGranularity::kScrollByPage;
|
||||
EXPECT_EQ(expected_disposition_,
|
||||
input_handler_->RouteToTypeSpecificHandler(gesture_));
|
||||
|
||||
|
@ -171,7 +171,7 @@ void InputScrollElasticityController::ObserveGestureEventAndResult(
|
||||
gesture_event.data.scroll_begin.inertial_phase ==
|
||||
blink::WebGestureEvent::InertialPhaseState::kNonMomentum &&
|
||||
gesture_event.data.scroll_begin.delta_hint_units ==
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
ObserveRealScrollBegin(enter_momentum, leave_momentum);
|
||||
break;
|
||||
}
|
||||
|
@ -122,8 +122,7 @@ blink::WebMouseWheelEvent MakeWebMouseWheelEventFromUiEvent(
|
||||
EventFlagsToWebEventModifiers(event.flags()), event.time_stamp());
|
||||
|
||||
webkit_event.button = blink::WebMouseEvent::Button::kNoButton;
|
||||
webkit_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
webkit_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
|
||||
float offset_ordinal_x = event.x_offset_ordinal();
|
||||
float offset_ordinal_y = event.y_offset_ordinal();
|
||||
@ -478,11 +477,9 @@ blink::WebMouseWheelEvent MakeWebMouseWheelEventFromUiEvent(
|
||||
event.flags() & ui::EF_SCROLL_BY_PAGE));
|
||||
|
||||
if (event.flags() & ui::EF_PRECISION_SCROLLING_DELTA) {
|
||||
webkit_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
|
||||
webkit_event.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
|
||||
} else if (event.flags() & ui::EF_SCROLL_BY_PAGE) {
|
||||
webkit_event.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
webkit_event.delta_units = ui::ScrollGranularity::kScrollByPage;
|
||||
}
|
||||
|
||||
webkit_event.wheel_ticks_x =
|
||||
|
@ -232,11 +232,11 @@ WebMouseWheelEvent WebMouseWheelEventBuilder::Build(
|
||||
break;
|
||||
case SB_PAGEUP:
|
||||
wheel_delta = 1;
|
||||
result.delta_units = ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
result.delta_units = ui::ScrollGranularity::kScrollByPage;
|
||||
break;
|
||||
case SB_PAGEDOWN:
|
||||
wheel_delta = -1;
|
||||
result.delta_units = ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
result.delta_units = ui::ScrollGranularity::kScrollByPage;
|
||||
break;
|
||||
default: // We don't supoprt SB_THUMBPOSITION or SB_THUMBTRACK here.
|
||||
wheel_delta = 0;
|
||||
@ -294,20 +294,19 @@ WebMouseWheelEvent WebMouseWheelEventBuilder::Build(
|
||||
unsigned long scroll_lines = kDefaultScrollLinesPerWheelDelta;
|
||||
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scroll_lines, 0);
|
||||
if (scroll_lines == WHEEL_PAGESCROLL)
|
||||
result.delta_units = ui::input_types::ScrollGranularity::kScrollByPage;
|
||||
result.delta_units = ui::ScrollGranularity::kScrollByPage;
|
||||
else
|
||||
scroll_delta *= static_cast<float>(scroll_lines);
|
||||
}
|
||||
|
||||
if (result.delta_units != ui::input_types::ScrollGranularity::kScrollByPage) {
|
||||
if (result.delta_units != ui::ScrollGranularity::kScrollByPage) {
|
||||
if (base::FeatureList::IsEnabled(features::kPercentBasedScrolling)) {
|
||||
// If percent-based scrolling is enabled, the scroll_delta represents
|
||||
// the percentage amount (out of 1, i.e. 1 == 100%) the targeted scroller
|
||||
// should scroll. This percentage will be resolved against the size of
|
||||
// the scroller in the renderer process.
|
||||
scroll_delta *= kScrollPercentPerLineOrChar / 100.f;
|
||||
result.delta_units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPercentage;
|
||||
result.delta_units = ui::ScrollGranularity::kScrollByPercentage;
|
||||
} else {
|
||||
// Convert wheel delta amount to a number of pixels to scroll.
|
||||
//
|
||||
|
@ -66,7 +66,7 @@ TEST(WebInputEventBuilderTest, TestPercentMouseWheelScroll) {
|
||||
::GetDesktopWindow(), WM_MOUSEWHEEL, MAKEWPARAM(0, -WHEEL_DELTA),
|
||||
MAKELPARAM(0, 0), base::TimeTicks() + base::TimeDelta::FromSeconds(100),
|
||||
blink::WebPointerProperties::PointerType::kMouse);
|
||||
EXPECT_EQ(ui::input_types::ScrollGranularity::kScrollByPercentage,
|
||||
EXPECT_EQ(ui::ScrollGranularity::kScrollByPercentage,
|
||||
mouse_wheel.delta_units);
|
||||
EXPECT_FLOAT_EQ(0.f, mouse_wheel.delta_x);
|
||||
EXPECT_FLOAT_EQ(
|
||||
@ -79,7 +79,7 @@ TEST(WebInputEventBuilderTest, TestPercentMouseWheelScroll) {
|
||||
::GetDesktopWindow(), WM_MOUSEHWHEEL, MAKEWPARAM(0, -WHEEL_DELTA),
|
||||
MAKELPARAM(0, 0), base::TimeTicks() + base::TimeDelta::FromSeconds(100),
|
||||
blink::WebPointerProperties::PointerType::kMouse);
|
||||
EXPECT_EQ(ui::input_types::ScrollGranularity::kScrollByPercentage,
|
||||
EXPECT_EQ(ui::ScrollGranularity::kScrollByPercentage,
|
||||
mouse_wheel.delta_units);
|
||||
EXPECT_FLOAT_EQ(
|
||||
0.05f, mouse_wheel.delta_x / static_cast<float>(system_scroll_chars));
|
||||
|
@ -19,11 +19,10 @@ GestureEventDetails::GestureEventDetails(ui::EventType type)
|
||||
DCHECK_LE(type, ET_GESTURE_TYPE_END);
|
||||
}
|
||||
|
||||
GestureEventDetails::GestureEventDetails(
|
||||
ui::EventType type,
|
||||
float delta_x,
|
||||
float delta_y,
|
||||
ui::input_types::ScrollGranularity units)
|
||||
GestureEventDetails::GestureEventDetails(ui::EventType type,
|
||||
float delta_x,
|
||||
float delta_y,
|
||||
ui::ScrollGranularity units)
|
||||
: type_(type),
|
||||
device_type_(GestureDeviceType::DEVICE_UNKNOWN),
|
||||
touch_points_(1) {
|
||||
|
@ -22,12 +22,11 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
|
||||
GestureEventDetails();
|
||||
explicit GestureEventDetails(EventType type);
|
||||
|
||||
GestureEventDetails(
|
||||
EventType type,
|
||||
float delta_x,
|
||||
float delta_y,
|
||||
ui::input_types::ScrollGranularity units =
|
||||
ui::input_types::ScrollGranularity::kScrollByPrecisePixel);
|
||||
GestureEventDetails(EventType type,
|
||||
float delta_x,
|
||||
float delta_y,
|
||||
ui::ScrollGranularity units =
|
||||
ui::ScrollGranularity::kScrollByPrecisePixel);
|
||||
|
||||
// The caller is responsible for ensuring that the gesture data from |other|
|
||||
// is compatible and sufficient for that expected by gestures of |type|.
|
||||
@ -82,7 +81,7 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
|
||||
return data_.scroll_begin.y_hint;
|
||||
}
|
||||
|
||||
ui::input_types::ScrollGranularity scroll_begin_units() const {
|
||||
ui::ScrollGranularity scroll_begin_units() const {
|
||||
DCHECK_EQ(ET_GESTURE_SCROLL_BEGIN, type_);
|
||||
return data_.scroll_begin.delta_hint_units;
|
||||
}
|
||||
@ -97,7 +96,7 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
|
||||
return data_.scroll_update.y;
|
||||
}
|
||||
|
||||
ui::input_types::ScrollGranularity scroll_update_units() const {
|
||||
ui::ScrollGranularity scroll_update_units() const {
|
||||
DCHECK_EQ(ET_GESTURE_SCROLL_UPDATE, type_);
|
||||
return data_.scroll_update.delta_units;
|
||||
}
|
||||
@ -186,13 +185,13 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
|
||||
// the x/y values from the first scroll_update.
|
||||
float x_hint;
|
||||
float y_hint;
|
||||
ui::input_types::ScrollGranularity delta_hint_units;
|
||||
ui::ScrollGranularity delta_hint_units;
|
||||
} scroll_begin;
|
||||
|
||||
struct { // SCROLL delta.
|
||||
float x;
|
||||
float y;
|
||||
ui::input_types::ScrollGranularity delta_units;
|
||||
ui::ScrollGranularity delta_units;
|
||||
// Whether any previous scroll update in the current scroll sequence was
|
||||
// suppressed because the underlying touch was consumed.
|
||||
} scroll_update;
|
||||
|
@ -12,9 +12,8 @@
|
||||
#undef IPC_MESSAGE_EXPORT
|
||||
#define IPC_MESSAGE_EXPORT COMPONENT_EXPORT(UI_EVENTS_IPC)
|
||||
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(
|
||||
ui::input_types::ScrollGranularity,
|
||||
ui::input_types::ScrollGranularity::kFirstScrollGranularity,
|
||||
ui::input_types::ScrollGranularity::kMaxValue)
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(ui::ScrollGranularity,
|
||||
ui::ScrollGranularity::kFirstScrollGranularity,
|
||||
ui::ScrollGranularity::kMaxValue)
|
||||
|
||||
#endif // UI_EVENTS_IPC_UI_EVENTS_PARAM_TRAITS_MACROS_H_
|
||||
|
@ -5,8 +5,5 @@
|
||||
mojom = "//ui/events/mojom/scroll_granularity.mojom"
|
||||
public_headers = [ "//ui/events/types/scroll_types.h" ]
|
||||
traits_headers = [ "//ui/events/ipc/ui_events_param_traits_macros.h" ]
|
||||
public_deps = [
|
||||
"//ui/events/ipc",
|
||||
]
|
||||
type_mappings =
|
||||
[ "ui.mojom.ScrollGranularity=::ui::input_types::ScrollGranularity" ]
|
||||
public_deps = [ "//ui/events/ipc" ]
|
||||
type_mappings = [ "ui.mojom.ScrollGranularity=::ui::ScrollGranularity" ]
|
||||
|
@ -1,6 +1,4 @@
|
||||
This directory contains a set of basic types related to input events that can
|
||||
be used across the input pipeline, from the UI layer down to consumers such as
|
||||
CC and Blink. These types are in the ```ui::input_types``` namespace to
|
||||
distinguish from the ```ui``` namespace which in general is not able to be
|
||||
included from all of those components.
|
||||
CC and Blink.
|
||||
Please do not add code/types that should not be reachable from Blink.
|
||||
|
@ -7,8 +7,6 @@
|
||||
|
||||
namespace ui {
|
||||
|
||||
namespace input_types {
|
||||
|
||||
enum class ScrollGranularity : uint8_t {
|
||||
kScrollByPrecisePixel = 0,
|
||||
kFirstScrollGranularity = kScrollByPrecisePixel,
|
||||
@ -20,8 +18,6 @@ enum class ScrollGranularity : uint8_t {
|
||||
kMaxValue = kScrollByPercentage
|
||||
};
|
||||
|
||||
} // namespace input_types
|
||||
|
||||
} // namespace ui
|
||||
|
||||
#endif // UI_EVENTS_TYPES_SCROLL_TYPES_H_
|
||||
|
Reference in New Issue
Block a user