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 "content/renderer/input/input_handler_proxy.h" | 5 #include "content/renderer/input/input_handler_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 break; | 551 break; |
552 } | 552 } |
553 return DID_NOT_HANDLE; | 553 return DID_NOT_HANDLE; |
554 } | 554 } |
555 | 555 |
556 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleTouchStart( | 556 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleTouchStart( |
557 const blink::WebTouchEvent& touch_event) { | 557 const blink::WebTouchEvent& touch_event) { |
558 for (size_t i = 0; i < touch_event.touchesLength; ++i) { | 558 for (size_t i = 0; i < touch_event.touchesLength; ++i) { |
559 if (touch_event.touches[i].state != WebTouchPoint::StatePressed) | 559 if (touch_event.touches[i].state != WebTouchPoint::StatePressed) |
560 continue; | 560 continue; |
561 if (input_handler_->HaveTouchEventHandlersAt( | 561 if (input_handler_->DoTouchEventsBlockScrollAt( |
562 gfx::Point(touch_event.touches[i].position.x, | 562 gfx::Point(touch_event.touches[i].position.x, |
563 touch_event.touches[i].position.y))) { | 563 touch_event.touches[i].position.y))) { |
| 564 // TODO(rbyers): We should consider still sending the touch events to |
| 565 // main asynchronously (crbug.com/455539). |
564 return DID_NOT_HANDLE; | 566 return DID_NOT_HANDLE; |
565 } | 567 } |
566 } | 568 } |
567 return DROP_EVENT; | 569 return DROP_EVENT; |
568 } | 570 } |
569 | 571 |
570 bool InputHandlerProxy::FilterInputEventForFlingBoosting( | 572 bool InputHandlerProxy::FilterInputEventForFlingBoosting( |
571 const WebInputEvent& event) { | 573 const WebInputEvent& event) { |
572 if (!WebInputEvent::isGestureEventType(event.type)) | 574 if (!WebInputEvent::isGestureEventType(event.type)) |
573 return false; | 575 return false; |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 942 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
941 // Return true in this case to prevent early fling termination. | 943 // Return true in this case to prevent early fling termination. |
942 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 944 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
943 std::abs(clipped_increment.height) < kScrollEpsilon) | 945 std::abs(clipped_increment.height) < kScrollEpsilon) |
944 return true; | 946 return true; |
945 | 947 |
946 return did_scroll; | 948 return did_scroll; |
947 } | 949 } |
948 | 950 |
949 } // namespace content | 951 } // namespace content |
OLD | NEW |