| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 367 |
| 368 case WebInputEvent::TouchStart: | 368 case WebInputEvent::TouchStart: |
| 369 return HandleTouchStart(static_cast<const WebTouchEvent&>(event)); | 369 return HandleTouchStart(static_cast<const WebTouchEvent&>(event)); |
| 370 | 370 |
| 371 case WebInputEvent::TouchMove: | 371 case WebInputEvent::TouchMove: |
| 372 return HandleTouchMove(static_cast<const WebTouchEvent&>(event)); | 372 return HandleTouchMove(static_cast<const WebTouchEvent&>(event)); |
| 373 | 373 |
| 374 case WebInputEvent::TouchEnd: | 374 case WebInputEvent::TouchEnd: |
| 375 return HandleTouchEnd(static_cast<const WebTouchEvent&>(event)); | 375 return HandleTouchEnd(static_cast<const WebTouchEvent&>(event)); |
| 376 | 376 |
| 377 case WebInputEvent::MouseDown: { |
| 378 // Only for check scrollbar captured |
| 379 const WebMouseEvent& mouse_event = |
| 380 static_cast<const WebMouseEvent&>(event); |
| 381 |
| 382 if (mouse_event.button == blink::WebMouseEvent::Button::Left) { |
| 383 CHECK(input_handler_); |
| 384 input_handler_->MouseDown(); |
| 385 } |
| 386 return DID_NOT_HANDLE; |
| 387 } |
| 388 case WebInputEvent::MouseUp: { |
| 389 // Only for release scrollbar captured |
| 390 const WebMouseEvent& mouse_event = |
| 391 static_cast<const WebMouseEvent&>(event); |
| 392 |
| 393 if (mouse_event.button == blink::WebMouseEvent::Button::Left) { |
| 394 CHECK(input_handler_); |
| 395 input_handler_->MouseUp(); |
| 396 } |
| 397 return DID_NOT_HANDLE; |
| 398 } |
| 377 case WebInputEvent::MouseMove: { | 399 case WebInputEvent::MouseMove: { |
| 378 const WebMouseEvent& mouse_event = | 400 const WebMouseEvent& mouse_event = |
| 379 static_cast<const WebMouseEvent&>(event); | 401 static_cast<const WebMouseEvent&>(event); |
| 380 // TODO(tony): Ignore when mouse buttons are down? | |
| 381 // TODO(davemoore): This should never happen, but bug #326635 showed some | 402 // TODO(davemoore): This should never happen, but bug #326635 showed some |
| 382 // surprising crashes. | 403 // surprising crashes. |
| 383 CHECK(input_handler_); | 404 CHECK(input_handler_); |
| 384 input_handler_->MouseMoveAt(gfx::Point(mouse_event.x, mouse_event.y)); | 405 input_handler_->MouseMoveAt(gfx::Point(mouse_event.x, mouse_event.y)); |
| 385 return DID_NOT_HANDLE; | 406 return DID_NOT_HANDLE; |
| 386 } | 407 } |
| 387 | 408 |
| 388 default: | 409 default: |
| 389 if (WebInputEvent::isKeyboardEventType(event.type)) { | 410 if (WebInputEvent::isKeyboardEventType(event.type)) { |
| 390 // Only call |CancelCurrentFling()| if a fling was active, as it will | 411 // Only call |CancelCurrentFling()| if a fling was active, as it will |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 // is made asynchronously, to minimize divergence between main thread and | 1391 // is made asynchronously, to minimize divergence between main thread and |
| 1371 // impl thread event handling paths. | 1392 // impl thread event handling paths. |
| 1372 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1393 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 1373 FROM_HERE, | 1394 FROM_HERE, |
| 1374 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, | 1395 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, |
| 1375 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1396 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
| 1376 scroll_result)); | 1397 scroll_result)); |
| 1377 } | 1398 } |
| 1378 | 1399 |
| 1379 } // namespace ui | 1400 } // namespace ui |
| OLD | NEW |