Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_android.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
| index 120161d67e823db56a39e5bace562b2155e70849..e7c22af6655e7316540619f1f8fc467794e2a3a2 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
| @@ -194,7 +194,8 @@ RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( |
| widget_host->GetRoutingID()) != NULL), |
| frame_evictor_(new DelegatedFrameEvictor(this)), |
| locks_on_frame_count_(0), |
| - observing_root_window_(false) { |
| + observing_root_window_(false), |
| + convert_touch_sequence_to_mouse_(false) { |
| host_->SetView(this); |
| SetContentViewCore(content_view_core); |
| ImageTransportFactoryAndroid::AddObserver(this); |
| @@ -547,6 +548,21 @@ bool RenderWidgetHostViewAndroid::OnTouchEvent( |
| if (!host_) |
| return false; |
| + if (event.GetAction() == ui::MotionEvent::ACTION_DOWN) { |
| + convert_touch_sequence_to_mouse_ = |
|
jdduke (slow)
2014/06/20 16:52:49
Sorry, my previous comment was confusing.
You'll
Changwan Ryu
2014/06/23 06:39:22
Done.
|
| + ContentViewCoreImpl::ShouldConvertToMouseEvent(event); |
| + // TODO(changwan): add a gesture detector to handle the long press event. |
|
jdduke (slow)
2014/06/20 16:52:49
If you move this block below as in the previous co
Changwan Ryu
2014/06/23 06:39:22
Done.
|
| + } |
| + |
| + if (convert_touch_sequence_to_mouse_) { |
| + SendMouseEvent(CreateWebMouseEventFromMotionEvent(event)); |
| + gesture_provider_.OnTouchEventAck(false); |
| + if (event.GetAction() == ui::MotionEvent::ACTION_UP || |
|
jdduke (slow)
2014/06/20 16:52:49
I lied, we actually don't want this line to reset
Changwan Ryu
2014/06/23 06:39:22
Done.
|
| + event.GetAction() == ui::MotionEvent::ACTION_CANCEL) |
| + convert_touch_sequence_to_mouse_ = false; |
| + return true; |
| + } |
| + |
| if (!gesture_provider_.OnTouchEvent(event)) |
| return false; |