| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 ? -wheel_event.deltaX | 426 ? -wheel_event.deltaX |
| 427 : 0, | 427 : 0, |
| 428 wheel_event.railsMode != WebInputEvent::RailsModeHorizontal | 428 wheel_event.railsMode != WebInputEvent::RailsModeHorizontal |
| 429 ? -wheel_event.deltaY | 429 ? -wheel_event.deltaY |
| 430 : 0); | 430 : 0); |
| 431 | 431 |
| 432 if (wheel_event.scrollByPage) { | 432 if (wheel_event.scrollByPage) { |
| 433 // TODO(jamesr): We don't properly handle scroll by page in the compositor | 433 // TODO(jamesr): We don't properly handle scroll by page in the compositor |
| 434 // thread, so punt it to the main thread. http://crbug.com/236639 | 434 // thread, so punt it to the main thread. http://crbug.com/236639 |
| 435 result = DID_NOT_HANDLE; | 435 result = DID_NOT_HANDLE; |
| 436 RecordMainThreadScrollingReasons(wheel_event.type, |
| 437 cc::InputHandler::PAGE_BASED_SCROLLING); |
| 438 |
| 436 } else if (!wheel_event.canScroll) { | 439 } else if (!wheel_event.canScroll) { |
| 437 // Wheel events with |canScroll| == false will not trigger scrolling, | 440 // Wheel events with |canScroll| == false will not trigger scrolling, |
| 438 // only event handlers. Forward to the main thread. | 441 // only event handlers. Forward to the main thread. |
| 439 result = DID_NOT_HANDLE; | 442 result = DID_NOT_HANDLE; |
| 440 } else if (ShouldAnimate(wheel_event)) { | 443 } else if (ShouldAnimate(wheel_event)) { |
| 441 cc::InputHandler::ScrollStatus scroll_status = | 444 cc::InputHandler::ScrollStatus scroll_status = |
| 442 input_handler_->ScrollAnimated(gfx::Point(wheel_event.x, wheel_event.y), | 445 input_handler_->ScrollAnimated(gfx::Point(wheel_event.x, wheel_event.y), |
| 443 scroll_delta); | 446 scroll_delta); |
| 444 | 447 |
| 445 RecordMainThreadScrollingReasons( | 448 RecordMainThreadScrollingReasons( |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 1148 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
| 1146 // Return true in this case to prevent early fling termination. | 1149 // Return true in this case to prevent early fling termination. |
| 1147 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 1150 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
| 1148 std::abs(clipped_increment.height) < kScrollEpsilon) | 1151 std::abs(clipped_increment.height) < kScrollEpsilon) |
| 1149 return true; | 1152 return true; |
| 1150 | 1153 |
| 1151 return did_scroll; | 1154 return did_scroll; |
| 1152 } | 1155 } |
| 1153 | 1156 |
| 1154 } // namespace ui | 1157 } // namespace ui |
| OLD | NEW |