/** See {@link android.webkit.WebSettings#setMediaPlaybackRequiresUserGesture}. */ public void setMediaPlaybackRequiresUserGesture(boolean require) { synchronized (mXWalkSettingsLock) { if (mMediaPlaybackRequiresUserGesture != require) { mMediaPlaybackRequiresUserGesture = require; mEventHandler.updateWebkitPreferencesLocked(); } } }
/** See {@link android.webkit.WebSettings#setUseWideViewPort}. */ public void setUseWideViewPort(boolean use) { synchronized (mXWalkSettingsLock) { if (mUseWideViewport != use) { mUseWideViewport = use; mEventHandler.updateWebkitPreferencesLocked(); } } }
/** See {@link android.webkit.WebSettings#setDatabaseEnabled}. */ public void setDatabaseEnabled(boolean flag) { synchronized (mXWalkSettingsLock) { if (mDatabaseEnabled != flag) { mDatabaseEnabled = flag; mEventHandler.updateWebkitPreferencesLocked(); } } }
/** See {@link android.webkit.WebSettings#setSupportMultipleWindows}. */ public void setSupportMultipleWindows(boolean support) { synchronized (mXWalkSettingsLock) { if (mSupportMultipleWindows != support) { mSupportMultipleWindows = support; mEventHandler.updateWebkitPreferencesLocked(); } } }
/** See {@link android.webkit.WebSettings#setJavaScriptCanOpenWindowsAutomatically}. */ public void setJavaScriptCanOpenWindowsAutomatically(boolean flag) { synchronized (mXWalkSettingsLock) { if (mJavaScriptCanOpenWindowsAutomatically != flag) { mJavaScriptCanOpenWindowsAutomatically = flag; mEventHandler.updateWebkitPreferencesLocked(); } } }
/** See {@link android.webkit.WebSettings#setLoadsImagesAutomatically}. */ public void setLoadsImagesAutomatically(boolean flag) { synchronized (mXWalkSettingsLock) { if (mLoadsImagesAutomatically != flag) { mLoadsImagesAutomatically = flag; mEventHandler.updateWebkitPreferencesLocked(); } } }
/** See {@link android.webkit.WebSettings#setAllowFileAccessFromFileURLs}. */ public void setAllowFileAccessFromFileURLs(boolean flag) { synchronized (mXWalkSettingsLock) { if (mAllowFileAccessFromFileURLs != flag) { mAllowFileAccessFromFileURLs = flag; mEventHandler.updateWebkitPreferencesLocked(); } } }
/** See {@link android.webkit.WebSettings#setDefaultVideoPosterURL}. */ public void setDefaultVideoPosterURL(String url) { synchronized (mXWalkSettingsLock) { if (mDefaultVideoPosterURL != null && !mDefaultVideoPosterURL.equals(url) || mDefaultVideoPosterURL == null && url != null) { mDefaultVideoPosterURL = url; mEventHandler.updateWebkitPreferencesLocked(); } } }
/** See {@link android.webkit.WebSettings#setAppCachePath}. */ public void setAppCachePath(String path) { boolean needToSync = false; synchronized (sGlobalContentSettingsLock) { // AppCachePath can only be set once. if (!sAppCachePathIsSet && path != null && !path.isEmpty()) { sAppCachePathIsSet = true; needToSync = true; } } // The obvious problem here is that other WebViews will not be updated, // until they execute synchronization from Java to the native side. // But this is the same behaviour as it was in the legacy WebView. if (needToSync) { synchronized (mXWalkSettingsLock) { mEventHandler.updateWebkitPreferencesLocked(); } } }