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

Unified Diff: content/renderer/input/input_handler_proxy.cc

Issue 1063853005: Unify Android Webview and Chrome's fling (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: add a todo Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/input/input_handler_proxy.cc
diff --git a/content/renderer/input/input_handler_proxy.cc b/content/renderer/input/input_handler_proxy.cc
index 4e2802dad8ad5f34145b7129e2812aaa64ed5768..e4f8b991af1b42f70aed7ca92e83f72affcbdb88 100644
--- a/content/renderer/input/input_handler_proxy.cc
+++ b/content/renderer/input/input_handler_proxy.cc
@@ -420,7 +420,9 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel(
InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin(
const WebGestureEvent& gesture_event) {
- DCHECK(!gesture_scroll_on_impl_thread_);
+ if (gesture_scroll_on_impl_thread_)
+ CancelCurrentFling();
+
#ifndef NDEBUG
DCHECK(!expect_scroll_update_end_);
expect_scroll_update_end_ = true;
@@ -532,7 +534,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureFlingStart(
WebPoint(gesture_event.globalX, gesture_event.globalY);
fling_parameters_.modifiers = gesture_event.modifiers;
fling_parameters_.sourceDevice = gesture_event.sourceDevice;
- input_handler_->SetNeedsAnimate();
+ input_handler_->SetNeedsAnimateInput();
return DID_HANDLE;
}
case cc::InputHandler::SCROLL_UNKNOWN:
@@ -754,7 +756,7 @@ void InputHandlerProxy::Animate(base::TimeTicks time) {
monotonic_time_sec >= fling_parameters_.startTime +
kMaxSecondsFromFlingTimestampToFirstAnimate) {
fling_parameters_.startTime = monotonic_time_sec;
- input_handler_->SetNeedsAnimate();
+ input_handler_->SetNeedsAnimateInput();
return;
}
}
@@ -767,7 +769,7 @@ void InputHandlerProxy::Animate(base::TimeTicks time) {
fling_is_active = false;
if (fling_is_active) {
- input_handler_->SetNeedsAnimate();
+ input_handler_->SetNeedsAnimateInput();
} else {
TRACE_EVENT_INSTANT0("input",
"InputHandlerProxy::animate::flingOver",

Powered by Google App Engine
This is Rietveld 408576698