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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 687323002: Experiment with emulating mouse hover with touch hover capable devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 1354e88b752a9865910f9568f09f73d57ab0fa83..baabaa697ed8c12e004a0ffbe04f43ea282288ff 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -513,6 +513,9 @@ public class ContentViewCore
// A ViewAndroidDelegate that delegates to the current container view.
private ContentViewAndroidDelegate mViewAndroidDelegate;
+ // A flag to determine if we enable hover feature or not.
+ private Boolean mEnableTouchHover;
+
/**
* Constructs a new ContentViewCore. Embedders must call initialize() after constructing
* a ContentViewCore and before using it.
@@ -1608,6 +1611,15 @@ public class ContentViewCore
*/
public boolean onHoverEvent(MotionEvent event) {
TraceEvent.begin("onHoverEvent");
+ // TODO(lanwei): Remove this switch once experimentation is complete -
+ // crbug.com/418188
+ if (event.getToolType(0) == MotionEvent.TOOL_TYPE_FINGER) {
+ if (mEnableTouchHover == null) {
+ mEnableTouchHover =
+ CommandLine.getInstance().hasSwitch(ContentSwitches.ENABLE_TOUCH_HOVER);
+ }
+ if (!mEnableTouchHover.booleanValue()) return false;
+ }
MotionEvent offset = createOffsetMotionEvent(event);
try {
if (mBrowserAccessibilityManager != null) {
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | content/public/android/java/src/org/chromium/content/common/ContentSwitches.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698