| Index: content/renderer/render_view_impl.cc
|
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
| index 7d6113cf65bf6f2f7270097e668eff44b6c7feb7..fb86a9f255d13359abb16191814e53c36b3fb9c9 100644
|
| --- a/content/renderer/render_view_impl.cc
|
| +++ b/content/renderer/render_view_impl.cc
|
| @@ -725,7 +725,7 @@ void RenderViewImpl::Initialize(
|
| OnEnableAutoResize(params.min_size, params.max_size);
|
| }
|
|
|
| - new IdleUserDetector(this);
|
| + idle_user_detector_.reset(new IdleUserDetector(this));
|
|
|
| GetContentClient()->renderer()->RenderViewCreated(this);
|
|
|
| @@ -765,6 +765,7 @@ RenderViewImpl::~RenderViewImpl() {
|
| DCHECK_NE(this, it->second) << "Failed to call Close?";
|
| #endif
|
|
|
| + idle_user_detector_.reset();
|
| for (auto& observer : observers_)
|
| observer.RenderViewGone();
|
| for (auto& observer : observers_)
|
| @@ -2663,21 +2664,29 @@ void RenderViewImpl::OnDiscardInputEvent(
|
| const std::vector<const blink::WebInputEvent*>& coalesced_events,
|
| const ui::LatencyInfo& latency_info,
|
| InputEventDispatchType dispatch_type) {
|
| - if (!input_event || (dispatch_type != DISPATCH_TYPE_BLOCKING &&
|
| - dispatch_type != DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN)) {
|
| + if (!input_event || dispatch_type == DISPATCH_TYPE_NON_BLOCKING) {
|
| return;
|
| }
|
|
|
| - if (dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN) {
|
| - NotifyInputEventHandled(input_event->GetType(),
|
| - blink::WebInputEventResult::kNotHandled,
|
| - INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
|
| - }
|
| -
|
| std::unique_ptr<InputEventAck> ack(new InputEventAck(
|
| InputEventAckSource::MAIN_THREAD, input_event->GetType(),
|
| INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
|
| OnInputEventAck(std::move(ack));
|
| }
|
|
|
| +InputEventAckState RenderViewImpl::HandleInputEvent(
|
| + const blink::WebCoalescedInputEvent& input_event,
|
| + const ui::LatencyInfo& latency_info,
|
| + InputEventDispatchType dispatch_type) {
|
| + if (is_swapped_out_) {
|
| + OnDiscardInputEvent(&input_event.Event(),
|
| + input_event.GetCoalescedEventsPointers(), latency_info,
|
| + dispatch_type);
|
| + return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
|
| + }
|
| + idle_user_detector_->ActivityDetected();
|
| + return RenderWidget::HandleInputEvent(input_event, latency_info,
|
| + dispatch_type);
|
| +}
|
| +
|
| } // namespace content
|
|
|