Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_impl.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc |
| index 3b93544dbc9bd8efccc9bd2e4549160fc561c4dd..97e66840c36017dd8be0f5aa6bbace0ba5494dee 100644 |
| --- a/content/browser/renderer_host/render_widget_host_impl.cc |
| +++ b/content/browser/renderer_host/render_widget_host_impl.cc |
| @@ -135,6 +135,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, |
| mouse_move_pending_(false), |
| mouse_wheel_pending_(false), |
| gesture_event_pending_(false), |
| + select_range_pending_(false), |
| needs_repainting_on_restore_(false), |
| is_unresponsive_(false), |
| in_flight_event_count_(0), |
| @@ -288,6 +289,7 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) { |
| IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnMsgUpdateIsDelayed) |
| IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnMsgInputEventAck) |
| IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnMsgBeginSmoothScroll) |
| + IPC_MESSAGE_HANDLER(ViewHostMsg_SelectRange_ACK, OnMsgSelectRangeAck) |
| IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnMsgFocus) |
| IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnMsgBlur) |
| IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, |
| @@ -1513,6 +1515,14 @@ void RenderWidgetHostImpl::TickActiveSmoothScrollGesture() { |
| } |
| } |
| +void RenderWidgetHostImpl::OnMsgSelectRangeAck() { |
| + select_range_pending_ = false; |
| + if (next_select_range_.get()) { |
| + scoped_ptr<SelectionRange> next(next_select_range_.Pass()); |
| + SelectRange(next->start, next->end); |
| + } |
| +} |
| + |
| void RenderWidgetHostImpl::ProcessWheelAck(bool processed) { |
| mouse_wheel_pending_ = false; |
| @@ -1816,6 +1826,16 @@ void RenderWidgetHostImpl::ScrollFocusedEditableNodeIntoRect( |
| void RenderWidgetHostImpl::SelectRange(const gfx::Point& start, |
| const gfx::Point& end) { |
| + if (select_range_pending_) { |
|
darin (slow to review)
2012/08/06 18:27:41
by the way, if the renderer crashes, you probably
Iain Merrick
2012/08/13 13:17:23
Done.
|
| + if (!next_select_range_.get()) { |
| + next_select_range_.reset(new SelectionRange()); |
| + } |
| + next_select_range_->start = start; |
| + next_select_range_->end = end; |
| + return; |
| + } |
| + |
| + select_range_pending_ = true; |
| Send(new ViewMsg_SelectRange(GetRoutingID(), start, end)); |
| } |