| 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(), processed, | 394 delegate_->NotifyInputEventHandled(input_event.type(), ack_result); |
| 395 ack_result); | |
| 396 } | 395 } |
| 397 | 396 |
| 398 if ((dispatch_type == DISPATCH_TYPE_BLOCKING || | 397 if ((dispatch_type == DISPATCH_TYPE_BLOCKING || |
| 399 dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN)) { | 398 dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN)) { |
| 400 std::unique_ptr<InputEventAck> response(new InputEventAck( | 399 std::unique_ptr<InputEventAck> response(new InputEventAck( |
| 401 InputEventAckSource::MAIN_THREAD, input_event.type(), ack_result, | 400 InputEventAckSource::MAIN_THREAD, input_event.type(), ack_result, |
| 402 swap_latency_info, std::move(event_overscroll), | 401 swap_latency_info, std::move(event_overscroll), |
| 403 ui::WebInputEventTraits::GetUniqueTouchEventId(input_event))); | 402 ui::WebInputEventTraits::GetUniqueTouchEventId(input_event))); |
| 404 delegate_->OnInputEventAck(std::move(response)); | 403 delegate_->OnInputEventAck(std::move(response)); |
| 405 } else { | 404 } else { |
| 406 DCHECK(!event_overscroll) << "Unexpected overscroll for un-acked event"; | 405 DCHECK(!event_overscroll) << "Unexpected overscroll for un-acked event"; |
| 407 } | 406 } |
| 408 if (RenderThreadImpl::current()) { | 407 if (RenderThreadImpl::current()) { |
| 409 RenderThreadImpl::current() | 408 RenderThreadImpl::current() |
| 410 ->GetRendererScheduler() | 409 ->GetRendererScheduler() |
| 411 ->DidHandleInputEventOnMainThread(input_event, processed); | 410 ->DidHandleInputEventOnMainThread(input_event); |
| 412 } | 411 } |
| 413 | 412 |
| 414 #if defined(OS_ANDROID) | 413 #if defined(OS_ANDROID) |
| 415 // Allow the IME to be shown when the focus changes as a consequence | 414 // Allow the IME to be shown when the focus changes as a consequence |
| 416 // of a processed touch end event. | 415 // of a processed touch end event. |
| 417 if (input_event.type() == WebInputEvent::TouchEnd && | 416 if (input_event.type() == WebInputEvent::TouchEnd && |
| 418 processed != WebInputEventResult::NotHandled) { | 417 processed != WebInputEventResult::NotHandled) { |
| 419 delegate_->ShowVirtualKeyboard(); | 418 delegate_->ShowVirtualKeyboard(); |
| 420 } | 419 } |
| 421 #elif defined(USE_AURA) | 420 #elif defined(USE_AURA) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // it can be bundled in the event ack. | 461 // it can be bundled in the event ack. |
| 463 if (handling_event_overscroll_) { | 462 if (handling_event_overscroll_) { |
| 464 *handling_event_overscroll_ = std::move(params); | 463 *handling_event_overscroll_ = std::move(params); |
| 465 return; | 464 return; |
| 466 } | 465 } |
| 467 | 466 |
| 468 delegate_->OnDidOverscroll(*params); | 467 delegate_->OnDidOverscroll(*params); |
| 469 } | 468 } |
| 470 | 469 |
| 471 } // namespace content | 470 } // namespace content |
| OLD | NEW |