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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "content/renderer/input/input_handler_proxy_client.h" | 10 #include "content/renderer/input/input_handler_proxy_client.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 if (CancelCurrentFling(true)) | 215 if (CancelCurrentFling(true)) |
216 return DID_HANDLE; | 216 return DID_HANDLE; |
217 else if (!fling_may_be_active_on_main_thread_) | 217 else if (!fling_may_be_active_on_main_thread_) |
218 return DROP_EVENT; | 218 return DROP_EVENT; |
219 } else if (event.type == WebInputEvent::TouchStart) { | 219 } else if (event.type == WebInputEvent::TouchStart) { |
220 const WebTouchEvent& touch_event = | 220 const WebTouchEvent& touch_event = |
221 *static_cast<const WebTouchEvent*>(&event); | 221 *static_cast<const WebTouchEvent*>(&event); |
222 for (size_t i = 0; i < touch_event.touchesLength; ++i) { | 222 for (size_t i = 0; i < touch_event.touchesLength; ++i) { |
223 if (touch_event.touches[i].state != WebTouchPoint::StatePressed) | 223 if (touch_event.touches[i].state != WebTouchPoint::StatePressed) |
224 continue; | 224 continue; |
225 if (input_handler_->HaveTouchEventHandlersAt(touch_event.touches[i] | 225 if (input_handler_->HaveTouchEventHandlersAt( |
226 .position)) | 226 blink::WebPoint(touch_event.touches[i].position.x, |
| 227 touch_event.touches[i].position.y))) { |
227 return DID_NOT_HANDLE; | 228 return DID_NOT_HANDLE; |
| 229 } |
228 } | 230 } |
229 return DROP_EVENT; | 231 return DROP_EVENT; |
230 } else if (WebInputEvent::isKeyboardEventType(event.type)) { | 232 } else if (WebInputEvent::isKeyboardEventType(event.type)) { |
231 CancelCurrentFling(true); | 233 CancelCurrentFling(true); |
232 } else if (event.type == WebInputEvent::MouseMove) { | 234 } else if (event.type == WebInputEvent::MouseMove) { |
233 const WebMouseEvent& mouse_event = | 235 const WebMouseEvent& mouse_event = |
234 *static_cast<const WebMouseEvent*>(&event); | 236 *static_cast<const WebMouseEvent*>(&event); |
235 // TODO(tony): Ignore when mouse buttons are down? | 237 // TODO(tony): Ignore when mouse buttons are down? |
236 // TODO(davemoore): This should never happen, but bug #326635 showed some | 238 // TODO(davemoore): This should never happen, but bug #326635 showed some |
237 // surprising crashes. | 239 // surprising crashes. |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 TRACE_EVENT2("renderer", | 481 TRACE_EVENT2("renderer", |
480 "InputHandlerProxy::notifyCurrentFlingVelocity", | 482 "InputHandlerProxy::notifyCurrentFlingVelocity", |
481 "vx", | 483 "vx", |
482 velocity.width, | 484 velocity.width, |
483 "vy", | 485 "vy", |
484 velocity.height); | 486 velocity.height); |
485 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); | 487 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); |
486 } | 488 } |
487 | 489 |
488 } // namespace content | 490 } // namespace content |
OLD | NEW |