| 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/renderer/input/render_widget_input_handler.h" | 5 #include "content/renderer/input/render_widget_input_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 processed != WebInputEventResult::NotHandled); | 384 processed != WebInputEventResult::NotHandled); |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); | 388 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); |
| 389 | 389 |
| 390 if (dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN || | 390 if (dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN || |
| 391 dispatch_type == DISPATCH_TYPE_NON_BLOCKING_NOTIFY_MAIN) { | 391 dispatch_type == DISPATCH_TYPE_NON_BLOCKING_NOTIFY_MAIN) { |
| 392 // |non_blocking| means it was ack'd already by the InputHandlerProxy | 392 // |non_blocking| means it was ack'd already by the InputHandlerProxy |
| 393 // so let the delegate know the event has been handled. | 393 // so let the delegate know the event has been handled. |
| 394 delegate_->NotifyInputEventHandled(input_event.type(), ack_result); | 394 delegate_->NotifyInputEventHandled(input_event.type(), processed, |
| 395 ack_result); |
| 395 } | 396 } |
| 396 | 397 |
| 397 if ((dispatch_type == DISPATCH_TYPE_BLOCKING || | 398 if ((dispatch_type == DISPATCH_TYPE_BLOCKING || |
| 398 dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN)) { | 399 dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN)) { |
| 399 std::unique_ptr<InputEventAck> response(new InputEventAck( | 400 std::unique_ptr<InputEventAck> response(new InputEventAck( |
| 400 InputEventAckSource::MAIN_THREAD, input_event.type(), ack_result, | 401 InputEventAckSource::MAIN_THREAD, input_event.type(), ack_result, |
| 401 swap_latency_info, std::move(event_overscroll), | 402 swap_latency_info, std::move(event_overscroll), |
| 402 ui::WebInputEventTraits::GetUniqueTouchEventId(input_event))); | 403 ui::WebInputEventTraits::GetUniqueTouchEventId(input_event))); |
| 403 delegate_->OnInputEventAck(std::move(response)); | 404 delegate_->OnInputEventAck(std::move(response)); |
| 404 } else { | 405 } else { |
| 405 DCHECK(!event_overscroll) << "Unexpected overscroll for un-acked event"; | 406 DCHECK(!event_overscroll) << "Unexpected overscroll for un-acked event"; |
| 406 } | 407 } |
| 407 if (RenderThreadImpl::current()) { | 408 if (RenderThreadImpl::current()) { |
| 408 RenderThreadImpl::current() | 409 RenderThreadImpl::current() |
| 409 ->GetRendererScheduler() | 410 ->GetRendererScheduler() |
| 410 ->DidHandleInputEventOnMainThread(input_event); | 411 ->DidHandleInputEventOnMainThread(input_event, processed); |
| 411 } | 412 } |
| 412 | 413 |
| 413 #if defined(OS_ANDROID) | 414 #if defined(OS_ANDROID) |
| 414 // Allow the IME to be shown when the focus changes as a consequence | 415 // Allow the IME to be shown when the focus changes as a consequence |
| 415 // of a processed touch end event. | 416 // of a processed touch end event. |
| 416 if (input_event.type() == WebInputEvent::TouchEnd && | 417 if (input_event.type() == WebInputEvent::TouchEnd && |
| 417 processed != WebInputEventResult::NotHandled) { | 418 processed != WebInputEventResult::NotHandled) { |
| 418 delegate_->ShowVirtualKeyboard(); | 419 delegate_->ShowVirtualKeyboard(); |
| 419 } | 420 } |
| 420 #elif defined(USE_AURA) | 421 #elif defined(USE_AURA) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 // it can be bundled in the event ack. | 462 // it can be bundled in the event ack. |
| 462 if (handling_event_overscroll_) { | 463 if (handling_event_overscroll_) { |
| 463 *handling_event_overscroll_ = std::move(params); | 464 *handling_event_overscroll_ = std::move(params); |
| 464 return; | 465 return; |
| 465 } | 466 } |
| 466 | 467 |
| 467 delegate_->OnDidOverscroll(*params); | 468 delegate_->OnDidOverscroll(*params); |
| 468 } | 469 } |
| 469 | 470 |
| 470 } // namespace content | 471 } // namespace content |
| OLD | NEW |