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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 33823005: Dynamically enable spatial navigation based on events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 26c026d485a22739b1fd045160985ea2ace9b5f5..59b0998caed3462ad33ed2e0b355dafdb6503ca1 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -1226,6 +1226,9 @@ public class AwContents {
* @see android.webkit.WebView#dispatchKeyEvent(KeyEvent)
*/
public boolean dispatchKeyEvent(KeyEvent event) {
+ if (AwWebContentsDelegateAdapter.getViewDirectionFromKeyEvent(event) != 0) {
+ mSettings.setSpatialNavigationEnabled(true);
+ }
return mContentViewCore.dispatchKeyEvent(event);
}
@@ -1484,6 +1487,10 @@ public class AwContents {
public boolean onTouchEvent(MotionEvent event) {
if (mNativeAwContents == 0) return false;
+ if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
+ mSettings.setSpatialNavigationEnabled(false);
+ }
+
mScrollOffsetManager.setProcessingTouchEvent(true);
boolean rv = mContentViewCore.onTouchEvent(event);
mScrollOffsetManager.setProcessingTouchEvent(false);

Powered by Google App Engine
This is Rietveld 408576698