Commit a5384976 authored by David Bokan's avatar David Bokan Committed by Commit Bot

[Refactor] Set is_direct_manipulation in InputHandlerProxy

We kept |touch_scrolling_| simply to be able to set the
|is_direct_manipulation_| bit on the scroll state in ScrollBy. It's
cleaner to simply have InputHandlerProxy set this bit correctly in all
cases.

The majority of this CL is simply adding an extra parameter to the state
creation method in unit tests so that we can set the bit correctly there
too. This was a mechanical change.

Bug: 1016229
Change-Id: If0c46d283fb030f205ffd39cdb0c04dd9e1bd7a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1981335
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728517}
parent 6977b825
...@@ -3850,12 +3850,8 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl( ...@@ -3850,12 +3850,8 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl(
browser_controls_offset_manager_->ScrollBegin(); browser_controls_offset_manager_->ScrollBegin();
// TODO(majidvp): get rid of touch_scrolling_ and set is_direct_manipulation
// in input_handler_proxy instead.
touch_scrolling_ = type == InputHandler::TOUCHSCREEN;
wheel_scrolling_ = type == InputHandler::WHEEL; wheel_scrolling_ = type == InputHandler::WHEEL;
middle_click_autoscrolling_ = type == InputHandler::AUTOSCROLL; middle_click_autoscrolling_ = type == InputHandler::AUTOSCROLL;
scroll_state->set_is_direct_manipulation(touch_scrolling_);
LatchToScroller(scroll_state, scrolling_node); LatchToScroller(scroll_state, scrolling_node);
...@@ -4642,8 +4638,6 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( ...@@ -4642,8 +4638,6 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
float initial_top_controls_offset = float initial_top_controls_offset =
browser_controls_offset_manager_->ControlsTopOffset(); browser_controls_offset_manager_->ControlsTopOffset();
scroll_state->set_is_direct_manipulation(touch_scrolling_);
ScrollLatchedScroller(scroll_state); ScrollLatchedScroller(scroll_state);
bool did_scroll_x = scroll_state->caused_scroll_x(); bool did_scroll_x = scroll_state->caused_scroll_x();
......
...@@ -1062,7 +1062,6 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandler, ...@@ -1062,7 +1062,6 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandler,
std::unique_ptr<LayerTreeImpl> recycle_tree_; std::unique_ptr<LayerTreeImpl> recycle_tree_;
InputHandlerClient* input_handler_client_ = nullptr; InputHandlerClient* input_handler_client_ = nullptr;
bool touch_scrolling_ = false;
bool wheel_scrolling_ = false; bool wheel_scrolling_ = false;
bool middle_click_autoscrolling_ = false; bool middle_click_autoscrolling_ = false;
bool scroll_affects_scroll_handler_ = false; bool scroll_affects_scroll_handler_ = false;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -83,6 +83,8 @@ cc::ScrollState CreateScrollStateForGesture(const WebGestureEvent& event) { ...@@ -83,6 +83,8 @@ cc::ScrollState CreateScrollStateForGesture(const WebGestureEvent& event) {
NOTREACHED(); NOTREACHED();
break; break;
} }
scroll_state_data.is_direct_manipulation =
event.SourceDevice() == blink::WebGestureDevice::kTouchscreen;
return cc::ScrollState(scroll_state_data); return cc::ScrollState(scroll_state_data);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment