| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/renderer_host/render_widget_host_input_event_router.h" | 5 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
| 6 | 6 |
| 7 #include "base/debug/dump_without_crashing.h" | |
| 8 #include "cc/quads/surface_draw_quad.h" | 7 #include "cc/quads/surface_draw_quad.h" |
| 9 #include "cc/surfaces/surface_id_allocator.h" | 8 #include "cc/surfaces/surface_id_allocator.h" |
| 10 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
| 11 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 10 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 12 #include "content/common/frame_messages.h" | 11 #include "content/common/frame_messages.h" |
| 13 #include "third_party/WebKit/public/web/WebInputEvent.h" | 12 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 14 | 13 |
| 15 namespace { | 14 namespace { |
| 16 | 15 |
| 17 void TransformEventTouchPositions(blink::WebTouchEvent* event, | 16 void TransformEventTouchPositions(blink::WebTouchEvent* event, |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // means the GestureFlingCancel that always comes between ET_GESTURE_BEGIN and | 283 // means the GestureFlingCancel that always comes between ET_GESTURE_BEGIN and |
| 285 // GestureTapDown is sent to the previous target, in case it is still in a | 284 // GestureTapDown is sent to the previous target, in case it is still in a |
| 286 // fling. | 285 // fling. |
| 287 if (event->type == blink::WebInputEvent::GestureTapDown) { | 286 if (event->type == blink::WebInputEvent::GestureTapDown) { |
| 288 if (touchscreen_gesture_target_queue_.empty()) { | 287 if (touchscreen_gesture_target_queue_.empty()) { |
| 289 LOG(ERROR) << "Gesture sequence start detected with no target available."; | 288 LOG(ERROR) << "Gesture sequence start detected with no target available."; |
| 290 // Ignore this gesture sequence as no target is available. | 289 // Ignore this gesture sequence as no target is available. |
| 291 // TODO(wjmaclean): this only happens on Windows, and should not happen. | 290 // TODO(wjmaclean): this only happens on Windows, and should not happen. |
| 292 // https://crbug.com/595422 | 291 // https://crbug.com/595422 |
| 293 touchscreen_gesture_target_.target = nullptr; | 292 touchscreen_gesture_target_.target = nullptr; |
| 294 base::debug::DumpWithoutCrashing(); | |
| 295 return; | 293 return; |
| 296 } | 294 } |
| 297 | 295 |
| 298 touchscreen_gesture_target_ = touchscreen_gesture_target_queue_.front(); | 296 touchscreen_gesture_target_ = touchscreen_gesture_target_queue_.front(); |
| 299 touchscreen_gesture_target_queue_.pop_front(); | 297 touchscreen_gesture_target_queue_.pop_front(); |
| 300 } | 298 } |
| 301 | 299 |
| 302 if (!touchscreen_gesture_target_.target) | 300 if (!touchscreen_gesture_target_.target) |
| 303 return; | 301 return; |
| 304 | 302 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 331 if (!touchpad_gesture_target_.target) | 329 if (!touchpad_gesture_target_.target) |
| 332 return; | 330 return; |
| 333 | 331 |
| 334 // TODO(mohsen): Add tests to check event location. | 332 // TODO(mohsen): Add tests to check event location. |
| 335 event->x += touchpad_gesture_target_.delta.x(); | 333 event->x += touchpad_gesture_target_.delta.x(); |
| 336 event->y += touchpad_gesture_target_.delta.y(); | 334 event->y += touchpad_gesture_target_.delta.y(); |
| 337 touchpad_gesture_target_.target->ProcessGestureEvent(*event, latency); | 335 touchpad_gesture_target_.target->ProcessGestureEvent(*event, latency); |
| 338 } | 336 } |
| 339 | 337 |
| 340 } // namespace content | 338 } // namespace content |
| OLD | NEW |