| Index: android_webview/java/src/org/chromium/android_webview/AwSettings.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwSettings.java b/android_webview/java/src/org/chromium/android_webview/AwSettings.java
|
| index deee0a59776e63733066d171cc286f81901e4afe..65a77cb38b7e0a8b303ce33dec05b22a5bb6e798 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwSettings.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwSettings.java
|
| @@ -4,6 +4,7 @@
|
|
|
| package org.chromium.android_webview;
|
|
|
| +import android.content.pm.PackageManager;
|
| import android.content.Context;
|
| import android.os.Handler;
|
| import android.os.Looper;
|
| @@ -81,6 +82,7 @@ public class AwSettings {
|
| private boolean mMediaPlaybackRequiresUserGesture = true;
|
| private String mDefaultVideoPosterURL;
|
| private float mInitialPageScalePercent = 0;
|
| + private boolean mSpatialNavigationEnabled; // Default depends on device features.
|
|
|
| private final boolean mSupportLegacyQuirks;
|
|
|
| @@ -193,6 +195,10 @@ public class AwSettings {
|
| mUserAgent = LazyDefaultUserAgent.sInstance;
|
| onGestureZoomSupportChanged(supportsGestureZoomLocked());
|
|
|
| + // Best-guess a sensible initial value based on the features supported on the device.
|
| + mSpatialNavigationEnabled = !context.getPackageManager().hasSystemFeature(
|
| + PackageManager.FEATURE_TOUCHSCREEN);
|
| +
|
| // Respect the system setting for password echoing.
|
| mPasswordEchoEnabled = Settings.System.getInt(context.getContentResolver(),
|
| Settings.System.TEXT_SHOW_PASSWORD, 1) == 1;
|
| @@ -341,6 +347,20 @@ public class AwSettings {
|
| return mInitialPageScalePercent;
|
| }
|
|
|
| + void setSpatialNavigationEnabled(boolean enable) {
|
| + synchronized (mAwSettingsLock) {
|
| + if (mSpatialNavigationEnabled != enable) {
|
| + mSpatialNavigationEnabled = enable;
|
| + mEventHandler.updateWebkitPreferencesLocked();
|
| + }
|
| + }
|
| + }
|
| +
|
| + @CalledByNative
|
| + private boolean getSpatialNavigationLocked() {
|
| + return mSpatialNavigationEnabled;
|
| + }
|
| +
|
| /**
|
| * See {@link android.webkit.WebSettings#setNeedInitialFocus}.
|
| */
|
| @@ -1067,7 +1087,7 @@ public class AwSettings {
|
| }
|
|
|
| @CalledByNative
|
| - private boolean getPasswordEchoEnabled() {
|
| + private boolean getPasswordEchoEnabledLocked() {
|
| return mPasswordEchoEnabled;
|
| }
|
|
|
|
|