OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/blink/input_handler_proxy.h" | 5 #include "ui/events/blink/input_handler_proxy.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 return DID_HANDLE; | 768 return DID_HANDLE; |
769 } | 769 } |
770 case cc::InputHandler::SCROLL_UNKNOWN: | 770 case cc::InputHandler::SCROLL_UNKNOWN: |
771 case cc::InputHandler::SCROLL_ON_MAIN_THREAD: { | 771 case cc::InputHandler::SCROLL_ON_MAIN_THREAD: { |
772 TRACE_EVENT_INSTANT0("input", | 772 TRACE_EVENT_INSTANT0("input", |
773 "InputHandlerProxy::HandleGestureFling::" | 773 "InputHandlerProxy::HandleGestureFling::" |
774 "scroll_on_main_thread", | 774 "scroll_on_main_thread", |
775 TRACE_EVENT_SCOPE_THREAD); | 775 TRACE_EVENT_SCOPE_THREAD); |
776 gesture_scroll_on_impl_thread_ = false; | 776 gesture_scroll_on_impl_thread_ = false; |
777 fling_may_be_active_on_main_thread_ = true; | 777 fling_may_be_active_on_main_thread_ = true; |
| 778 client_->DidStartFlinging(); |
778 return DID_NOT_HANDLE; | 779 return DID_NOT_HANDLE; |
779 } | 780 } |
780 case cc::InputHandler::SCROLL_IGNORED: { | 781 case cc::InputHandler::SCROLL_IGNORED: { |
781 TRACE_EVENT_INSTANT0( | 782 TRACE_EVENT_INSTANT0( |
782 "input", | 783 "input", |
783 "InputHandlerProxy::HandleGestureFling::ignored", | 784 "InputHandlerProxy::HandleGestureFling::ignored", |
784 TRACE_EVENT_SCOPE_THREAD); | 785 TRACE_EVENT_SCOPE_THREAD); |
785 gesture_scroll_on_impl_thread_ = false; | 786 gesture_scroll_on_impl_thread_ = false; |
786 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) { | 787 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) { |
787 // We still pass the curve to the main thread if there's nothing | 788 // We still pass the curve to the main thread if there's nothing |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 "InputHandlerProxy::scrollBy::AbortFling", | 1267 "InputHandlerProxy::scrollBy::AbortFling", |
1267 TRACE_EVENT_SCOPE_THREAD); | 1268 TRACE_EVENT_SCOPE_THREAD); |
1268 // If we got a DID_NOT_HANDLE, that means we need to deliver wheels on the | 1269 // If we got a DID_NOT_HANDLE, that means we need to deliver wheels on the |
1269 // main thread. In this case we need to schedule a commit and transfer the | 1270 // main thread. In this case we need to schedule a commit and transfer the |
1270 // fling curve over to the main thread and run the rest of the wheels from | 1271 // fling curve over to the main thread and run the rest of the wheels from |
1271 // there. This can happen when flinging a page that contains a scrollable | 1272 // there. This can happen when flinging a page that contains a scrollable |
1272 // subarea that we can't scroll on the thread if the fling starts outside | 1273 // subarea that we can't scroll on the thread if the fling starts outside |
1273 // the subarea but then is flung "under" the pointer. | 1274 // the subarea but then is flung "under" the pointer. |
1274 client_->TransferActiveWheelFlingAnimation(fling_parameters_); | 1275 client_->TransferActiveWheelFlingAnimation(fling_parameters_); |
1275 fling_may_be_active_on_main_thread_ = true; | 1276 fling_may_be_active_on_main_thread_ = true; |
| 1277 client_->DidStartFlinging(); |
1276 CancelCurrentFlingWithoutNotifyingClient(); | 1278 CancelCurrentFlingWithoutNotifyingClient(); |
1277 break; | 1279 break; |
1278 } | 1280 } |
1279 | 1281 |
1280 return false; | 1282 return false; |
1281 } | 1283 } |
1282 | 1284 |
1283 bool InputHandlerProxy::scrollBy(const WebFloatSize& increment, | 1285 bool InputHandlerProxy::scrollBy(const WebFloatSize& increment, |
1284 const WebFloatSize& velocity) { | 1286 const WebFloatSize& velocity) { |
1285 WebFloatSize clipped_increment; | 1287 WebFloatSize clipped_increment; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 // is made asynchronously, to minimize divergence between main thread and | 1358 // is made asynchronously, to minimize divergence between main thread and |
1357 // impl thread event handling paths. | 1359 // impl thread event handling paths. |
1358 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1360 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1359 FROM_HERE, | 1361 FROM_HERE, |
1360 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, | 1362 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, |
1361 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1363 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
1362 scroll_result)); | 1364 scroll_result)); |
1363 } | 1365 } |
1364 | 1366 |
1365 } // namespace ui | 1367 } // namespace ui |
OLD | NEW |