| 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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 if (touch_event.touches[i].state != WebTouchPoint::StatePressed) | 243 if (touch_event.touches[i].state != WebTouchPoint::StatePressed) |
| 244 continue; | 244 continue; |
| 245 if (input_handler_->HaveTouchEventHandlersAt( | 245 if (input_handler_->HaveTouchEventHandlersAt( |
| 246 gfx::Point(touch_event.touches[i].position.x, | 246 gfx::Point(touch_event.touches[i].position.x, |
| 247 touch_event.touches[i].position.y))) { | 247 touch_event.touches[i].position.y))) { |
| 248 return DID_NOT_HANDLE; | 248 return DID_NOT_HANDLE; |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 return DROP_EVENT; | 251 return DROP_EVENT; |
| 252 } else if (WebInputEvent::isKeyboardEventType(event.type)) { | 252 } else if (WebInputEvent::isKeyboardEventType(event.type)) { |
| 253 CancelCurrentFling(true); | 253 // Only call |CancelCurrentFling()| if a fling was active, as it will |
| 254 // otherwise disrupt an in-progress touch scroll. |
| 255 if (fling_curve_) |
| 256 CancelCurrentFling(true); |
| 254 } else if (event.type == WebInputEvent::MouseMove) { | 257 } else if (event.type == WebInputEvent::MouseMove) { |
| 255 const WebMouseEvent& mouse_event = | 258 const WebMouseEvent& mouse_event = |
| 256 *static_cast<const WebMouseEvent*>(&event); | 259 *static_cast<const WebMouseEvent*>(&event); |
| 257 // TODO(tony): Ignore when mouse buttons are down? | 260 // TODO(tony): Ignore when mouse buttons are down? |
| 258 // TODO(davemoore): This should never happen, but bug #326635 showed some | 261 // TODO(davemoore): This should never happen, but bug #326635 showed some |
| 259 // surprising crashes. | 262 // surprising crashes. |
| 260 CHECK(input_handler_); | 263 CHECK(input_handler_); |
| 261 input_handler_->MouseMoveAt(gfx::Point(mouse_event.x, mouse_event.y)); | 264 input_handler_->MouseMoveAt(gfx::Point(mouse_event.x, mouse_event.y)); |
| 262 } | 265 } |
| 263 | 266 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 512 |
| 510 if (did_scroll) { | 513 if (did_scroll) { |
| 511 fling_parameters_.cumulativeScroll.width += clipped_increment.width; | 514 fling_parameters_.cumulativeScroll.width += clipped_increment.width; |
| 512 fling_parameters_.cumulativeScroll.height += clipped_increment.height; | 515 fling_parameters_.cumulativeScroll.height += clipped_increment.height; |
| 513 } | 516 } |
| 514 | 517 |
| 515 return did_scroll; | 518 return did_scroll; |
| 516 } | 519 } |
| 517 | 520 |
| 518 } // namespace content | 521 } // namespace content |
| OLD | NEW |