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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 return DID_HANDLE; | 771 return DID_HANDLE; |
772 } | 772 } |
773 case cc::InputHandler::SCROLL_UNKNOWN: | 773 case cc::InputHandler::SCROLL_UNKNOWN: |
774 case cc::InputHandler::SCROLL_ON_MAIN_THREAD: { | 774 case cc::InputHandler::SCROLL_ON_MAIN_THREAD: { |
775 TRACE_EVENT_INSTANT0("input", | 775 TRACE_EVENT_INSTANT0("input", |
776 "InputHandlerProxy::HandleGestureFling::" | 776 "InputHandlerProxy::HandleGestureFling::" |
777 "scroll_on_main_thread", | 777 "scroll_on_main_thread", |
778 TRACE_EVENT_SCOPE_THREAD); | 778 TRACE_EVENT_SCOPE_THREAD); |
779 gesture_scroll_on_impl_thread_ = false; | 779 gesture_scroll_on_impl_thread_ = false; |
780 fling_may_be_active_on_main_thread_ = true; | 780 fling_may_be_active_on_main_thread_ = true; |
| 781 client_->DidStartFlinging(); |
781 return DID_NOT_HANDLE; | 782 return DID_NOT_HANDLE; |
782 } | 783 } |
783 case cc::InputHandler::SCROLL_IGNORED: { | 784 case cc::InputHandler::SCROLL_IGNORED: { |
784 TRACE_EVENT_INSTANT0( | 785 TRACE_EVENT_INSTANT0( |
785 "input", | 786 "input", |
786 "InputHandlerProxy::HandleGestureFling::ignored", | 787 "InputHandlerProxy::HandleGestureFling::ignored", |
787 TRACE_EVENT_SCOPE_THREAD); | 788 TRACE_EVENT_SCOPE_THREAD); |
788 gesture_scroll_on_impl_thread_ = false; | 789 gesture_scroll_on_impl_thread_ = false; |
789 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) { | 790 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) { |
790 // We still pass the curve to the main thread if there's nothing | 791 // 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... |
1269 "InputHandlerProxy::scrollBy::AbortFling", | 1270 "InputHandlerProxy::scrollBy::AbortFling", |
1270 TRACE_EVENT_SCOPE_THREAD); | 1271 TRACE_EVENT_SCOPE_THREAD); |
1271 // If we got a DID_NOT_HANDLE, that means we need to deliver wheels on the | 1272 // If we got a DID_NOT_HANDLE, that means we need to deliver wheels on the |
1272 // main thread. In this case we need to schedule a commit and transfer the | 1273 // main thread. In this case we need to schedule a commit and transfer the |
1273 // fling curve over to the main thread and run the rest of the wheels from | 1274 // fling curve over to the main thread and run the rest of the wheels from |
1274 // there. This can happen when flinging a page that contains a scrollable | 1275 // there. This can happen when flinging a page that contains a scrollable |
1275 // subarea that we can't scroll on the thread if the fling starts outside | 1276 // subarea that we can't scroll on the thread if the fling starts outside |
1276 // the subarea but then is flung "under" the pointer. | 1277 // the subarea but then is flung "under" the pointer. |
1277 client_->TransferActiveWheelFlingAnimation(fling_parameters_); | 1278 client_->TransferActiveWheelFlingAnimation(fling_parameters_); |
1278 fling_may_be_active_on_main_thread_ = true; | 1279 fling_may_be_active_on_main_thread_ = true; |
| 1280 client_->DidStartFlinging(); |
1279 CancelCurrentFlingWithoutNotifyingClient(); | 1281 CancelCurrentFlingWithoutNotifyingClient(); |
1280 break; | 1282 break; |
1281 } | 1283 } |
1282 | 1284 |
1283 return false; | 1285 return false; |
1284 } | 1286 } |
1285 | 1287 |
1286 bool InputHandlerProxy::scrollBy(const WebFloatSize& increment, | 1288 bool InputHandlerProxy::scrollBy(const WebFloatSize& increment, |
1287 const WebFloatSize& velocity) { | 1289 const WebFloatSize& velocity) { |
1288 WebFloatSize clipped_increment; | 1290 WebFloatSize clipped_increment; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 // is made asynchronously, to minimize divergence between main thread and | 1361 // is made asynchronously, to minimize divergence between main thread and |
1360 // impl thread event handling paths. | 1362 // impl thread event handling paths. |
1361 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1363 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1362 FROM_HERE, | 1364 FROM_HERE, |
1363 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, | 1365 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, |
1364 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1366 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
1365 scroll_result)); | 1367 scroll_result)); |
1366 } | 1368 } |
1367 | 1369 |
1368 } // namespace ui | 1370 } // namespace ui |
OLD | NEW |