| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 handling_event_overscroll_(nullptr), | 184 handling_event_overscroll_(nullptr), |
| 185 handling_event_type_(WebInputEvent::Undefined), | 185 handling_event_type_(WebInputEvent::Undefined), |
| 186 context_menu_source_type_(ui::MENU_SOURCE_MOUSE), | 186 context_menu_source_type_(ui::MENU_SOURCE_MOUSE), |
| 187 suppress_next_char_events_(false), | 187 suppress_next_char_events_(false), |
| 188 ignore_ack_for_mouse_move_from_debugger_(false) { | 188 ignore_ack_for_mouse_move_from_debugger_(false) { |
| 189 DCHECK(delegate); | 189 DCHECK(delegate); |
| 190 DCHECK(widget); | 190 DCHECK(widget); |
| 191 delegate->SetInputHandler(this); | 191 delegate->SetInputHandler(this); |
| 192 } | 192 } |
| 193 | 193 |
| 194 RenderWidgetInputHandler::~RenderWidgetInputHandler() {} | 194 RenderWidgetInputHandler::~RenderWidgetInputHandler() { |
| 195 delegate_->SetInputHandler(nullptr); |
| 196 } |
| 195 | 197 |
| 196 void RenderWidgetInputHandler::HandleInputEvent( | 198 void RenderWidgetInputHandler::HandleInputEvent( |
| 197 const WebInputEvent& input_event, | 199 const WebInputEvent& input_event, |
| 198 const ui::LatencyInfo& latency_info, | 200 const ui::LatencyInfo& latency_info, |
| 199 InputEventDispatchType dispatch_type) { | 201 InputEventDispatchType dispatch_type) { |
| 200 base::AutoReset<bool> handling_input_event_resetter(&handling_input_event_, | 202 base::AutoReset<bool> handling_input_event_resetter(&handling_input_event_, |
| 201 true); | 203 true); |
| 202 base::AutoReset<WebInputEvent::Type> handling_event_type_resetter( | 204 base::AutoReset<WebInputEvent::Type> handling_event_type_resetter( |
| 203 &handling_event_type_, input_event.type); | 205 &handling_event_type_, input_event.type); |
| 204 | 206 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 if (pending_input_event_ack_) { | 557 if (pending_input_event_ack_) { |
| 556 TRACE_EVENT_ASYNC_END0("input", | 558 TRACE_EVENT_ASYNC_END0("input", |
| 557 "RenderWidgetInputHandler::ThrottledInputEventAck", | 559 "RenderWidgetInputHandler::ThrottledInputEventAck", |
| 558 pending_input_event_ack_.get()); | 560 pending_input_event_ack_.get()); |
| 559 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); | 561 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); |
| 560 } | 562 } |
| 561 total_input_handling_time_this_frame_ = base::TimeDelta(); | 563 total_input_handling_time_this_frame_ = base::TimeDelta(); |
| 562 } | 564 } |
| 563 | 565 |
| 564 } // namespace content | 566 } // namespace content |
| OLD | NEW |