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..edd6f7467d3d14cf4e5b09554c04b2ba123cca15 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,16 @@ void RenderWidgetHostImpl::TickActiveSmoothScrollGesture() { |
} |
} |
+void RenderWidgetHostImpl::OnMsgSelectRangeAck() { |
+ select_range_pending_ = false; |
+ if (next_select_range_.get()) { |
+ gfx::Point start = next_select_range_->first; |
darin (slow to review)
2012/08/02 16:37:17
consider using .Pass() here instead:
scoped_ptr
Iain Merrick
2012/08/06 11:28:45
Done.
|
+ gfx::Point end = next_select_range_->second; |
+ next_select_range_.reset(); |
+ SelectRange(start, end); |
+ } |
+} |
+ |
void RenderWidgetHostImpl::ProcessWheelAck(bool processed) { |
mouse_wheel_pending_ = false; |
@@ -1816,6 +1828,16 @@ void RenderWidgetHostImpl::ScrollFocusedEditableNodeIntoRect( |
void RenderWidgetHostImpl::SelectRange(const gfx::Point& start, |
const gfx::Point& end) { |
+ if (select_range_pending_) { |
+ if (!next_select_range_.get()) { |
+ next_select_range_.reset(new std::pair<gfx::Point, gfx::Point>()); |
+ } |
+ next_select_range_->first = start; |
+ next_select_range_->second = end; |
+ return; |
+ } |
+ |
+ select_range_pending_ = true; |
Send(new ViewMsg_SelectRange(GetRoutingID(), start, end)); |
} |