Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1674)

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 342633003: [Android] Select text when stylus first button is pressed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed predefined namespace Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698