OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 // send us the same kind of event we are delaying the ack for. | 1075 // send us the same kind of event we are delaying the ack for. |
1076 Send(pending_input_event_ack_.release()); | 1076 Send(pending_input_event_ack_.release()); |
1077 } | 1077 } |
1078 pending_input_event_ack_ = response.Pass(); | 1078 pending_input_event_ack_ = response.Pass(); |
1079 if (compositor_) | 1079 if (compositor_) |
1080 compositor_->NotifyInputThrottledUntilCommit(); | 1080 compositor_->NotifyInputThrottledUntilCommit(); |
1081 } else { | 1081 } else { |
1082 Send(response.release()); | 1082 Send(response.release()); |
1083 } | 1083 } |
1084 } | 1084 } |
1085 ignore_ack_for_mouse_move_from_debugger_ = false; | 1085 if (input_event->type == WebInputEvent::MouseMove) |
| 1086 ignore_ack_for_mouse_move_from_debugger_ = false; |
1086 | 1087 |
1087 #if defined(OS_ANDROID) | 1088 #if defined(OS_ANDROID) |
1088 // Allow the IME to be shown when the focus changes as a consequence | 1089 // Allow the IME to be shown when the focus changes as a consequence |
1089 // of a processed touch end event. | 1090 // of a processed touch end event. |
1090 if (input_event->type == WebInputEvent::TouchEnd && processed) | 1091 if (input_event->type == WebInputEvent::TouchEnd && processed) |
1091 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); | 1092 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); |
1092 #elif defined(USE_AURA) | 1093 #elif defined(USE_AURA) |
1093 // Show the virtual keyboard if enabled and a user gesture triggers a focus | 1094 // Show the virtual keyboard if enabled and a user gesture triggers a focus |
1094 // change. | 1095 // change. |
1095 if (processed && (input_event->type == WebInputEvent::TouchEnd || | 1096 if (processed && (input_event->type == WebInputEvent::TouchEnd || |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 bool RenderWidget::ShouldHandleImeEvent() { | 1514 bool RenderWidget::ShouldHandleImeEvent() { |
1514 #if defined(OS_ANDROID) | 1515 #if defined(OS_ANDROID) |
1515 return !!webwidget_ && outstanding_ime_acks_ == 0; | 1516 return !!webwidget_ && outstanding_ime_acks_ == 0; |
1516 #else | 1517 #else |
1517 return !!webwidget_; | 1518 return !!webwidget_; |
1518 #endif | 1519 #endif |
1519 } | 1520 } |
1520 | 1521 |
1521 bool RenderWidget::SendAckForMouseMoveFromDebugger() { | 1522 bool RenderWidget::SendAckForMouseMoveFromDebugger() { |
1522 if (handling_event_type_ == WebInputEvent::MouseMove) { | 1523 if (handling_event_type_ == WebInputEvent::MouseMove) { |
1523 InputHostMsg_HandleInputEvent_ACK_Params ack; | 1524 // If we pause multiple times during a single mouse move event, we should |
1524 ack.type = handling_event_type_; | 1525 // only send ACK once. |
1525 ack.state = INPUT_EVENT_ACK_STATE_CONSUMED; | 1526 if (!ignore_ack_for_mouse_move_from_debugger_) { |
1526 Send(new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack)); | 1527 InputHostMsg_HandleInputEvent_ACK_Params ack; |
| 1528 ack.type = handling_event_type_; |
| 1529 ack.state = INPUT_EVENT_ACK_STATE_CONSUMED; |
| 1530 Send(new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack)); |
| 1531 } |
1527 return true; | 1532 return true; |
1528 } | 1533 } |
1529 return false; | 1534 return false; |
1530 } | 1535 } |
1531 | 1536 |
1532 void RenderWidget::IgnoreAckForMouseMoveFromDebugger() { | 1537 void RenderWidget::IgnoreAckForMouseMoveFromDebugger() { |
1533 ignore_ack_for_mouse_move_from_debugger_ = true; | 1538 ignore_ack_for_mouse_move_from_debugger_ = true; |
1534 } | 1539 } |
1535 | 1540 |
1536 void RenderWidget::SetDeviceScaleFactor(float device_scale_factor) { | 1541 void RenderWidget::SetDeviceScaleFactor(float device_scale_factor) { |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2090 | 2095 |
2091 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2096 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2092 swapped_out_frames_.AddObserver(frame); | 2097 swapped_out_frames_.AddObserver(frame); |
2093 } | 2098 } |
2094 | 2099 |
2095 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2100 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2096 swapped_out_frames_.RemoveObserver(frame); | 2101 swapped_out_frames_.RemoveObserver(frame); |
2097 } | 2102 } |
2098 | 2103 |
2099 } // namespace content | 2104 } // namespace content |
OLD | NEW |