| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 : 0); | 482 : 0); |
| 483 | 483 |
| 484 if (wheel_event.scrollByPage) { | 484 if (wheel_event.scrollByPage) { |
| 485 // TODO(jamesr): We don't properly handle scroll by page in the compositor | 485 // TODO(jamesr): We don't properly handle scroll by page in the compositor |
| 486 // thread, so punt it to the main thread. http://crbug.com/236639 | 486 // thread, so punt it to the main thread. http://crbug.com/236639 |
| 487 result = DID_NOT_HANDLE; | 487 result = DID_NOT_HANDLE; |
| 488 RecordMainThreadScrollingReasons( | 488 RecordMainThreadScrollingReasons( |
| 489 blink::WebGestureDeviceTouchpad, | 489 blink::WebGestureDeviceTouchpad, |
| 490 cc::MainThreadScrollingReason::kPageBasedScrolling); | 490 cc::MainThreadScrollingReason::kPageBasedScrolling); |
| 491 | 491 |
| 492 } else if (!wheel_event.canScroll) { | |
| 493 // Wheel events with |canScroll| == false will not trigger scrolling, | |
| 494 // only event handlers. Forward to the main thread. | |
| 495 result = DID_NOT_HANDLE; | |
| 496 } else if (ShouldAnimate(wheel_event.hasPreciseScrollingDeltas)) { | 492 } else if (ShouldAnimate(wheel_event.hasPreciseScrollingDeltas)) { |
| 497 cc::InputHandler::ScrollStatus scroll_status = | 493 cc::InputHandler::ScrollStatus scroll_status = |
| 498 input_handler_->ScrollAnimated(gfx::Point(wheel_event.x, wheel_event.y), | 494 input_handler_->ScrollAnimated(gfx::Point(wheel_event.x, wheel_event.y), |
| 499 scroll_delta); | 495 scroll_delta); |
| 500 | 496 |
| 501 RecordMainThreadScrollingReasons( | 497 RecordMainThreadScrollingReasons( |
| 502 blink::WebGestureDeviceTouchpad, | 498 blink::WebGestureDeviceTouchpad, |
| 503 scroll_status.main_thread_scrolling_reasons); | 499 scroll_status.main_thread_scrolling_reasons); |
| 504 | 500 |
| 505 switch (scroll_status.thread) { | 501 switch (scroll_status.thread) { |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 // is made asynchronously, to minimize divergence between main thread and | 1355 // is made asynchronously, to minimize divergence between main thread and |
| 1360 // impl thread event handling paths. | 1356 // impl thread event handling paths. |
| 1361 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1357 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 1362 FROM_HERE, | 1358 FROM_HERE, |
| 1363 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, | 1359 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, |
| 1364 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1360 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
| 1365 scroll_result)); | 1361 scroll_result)); |
| 1366 } | 1362 } |
| 1367 | 1363 |
| 1368 } // namespace ui | 1364 } // namespace ui |
| OLD | NEW |