示例#1
0
 /** See {@link android.webkit.WebSettings#setMediaPlaybackRequiresUserGesture}. */
 public void setMediaPlaybackRequiresUserGesture(boolean require) {
   synchronized (mXWalkSettingsLock) {
     if (mMediaPlaybackRequiresUserGesture != require) {
       mMediaPlaybackRequiresUserGesture = require;
       mEventHandler.updateWebkitPreferencesLocked();
     }
   }
 }
示例#2
0
 /** See {@link android.webkit.WebSettings#setUseWideViewPort}. */
 public void setUseWideViewPort(boolean use) {
   synchronized (mXWalkSettingsLock) {
     if (mUseWideViewport != use) {
       mUseWideViewport = use;
       mEventHandler.updateWebkitPreferencesLocked();
     }
   }
 }
示例#3
0
 /** See {@link android.webkit.WebSettings#setDatabaseEnabled}. */
 public void setDatabaseEnabled(boolean flag) {
   synchronized (mXWalkSettingsLock) {
     if (mDatabaseEnabled != flag) {
       mDatabaseEnabled = flag;
       mEventHandler.updateWebkitPreferencesLocked();
     }
   }
 }
示例#4
0
 /** See {@link android.webkit.WebSettings#setSupportMultipleWindows}. */
 public void setSupportMultipleWindows(boolean support) {
   synchronized (mXWalkSettingsLock) {
     if (mSupportMultipleWindows != support) {
       mSupportMultipleWindows = support;
       mEventHandler.updateWebkitPreferencesLocked();
     }
   }
 }
示例#5
0
 /** See {@link android.webkit.WebSettings#setJavaScriptCanOpenWindowsAutomatically}. */
 public void setJavaScriptCanOpenWindowsAutomatically(boolean flag) {
   synchronized (mXWalkSettingsLock) {
     if (mJavaScriptCanOpenWindowsAutomatically != flag) {
       mJavaScriptCanOpenWindowsAutomatically = flag;
       mEventHandler.updateWebkitPreferencesLocked();
     }
   }
 }
示例#6
0
 /** See {@link android.webkit.WebSettings#setLoadsImagesAutomatically}. */
 public void setLoadsImagesAutomatically(boolean flag) {
   synchronized (mXWalkSettingsLock) {
     if (mLoadsImagesAutomatically != flag) {
       mLoadsImagesAutomatically = flag;
       mEventHandler.updateWebkitPreferencesLocked();
     }
   }
 }
示例#7
0
 /** See {@link android.webkit.WebSettings#setAllowFileAccessFromFileURLs}. */
 public void setAllowFileAccessFromFileURLs(boolean flag) {
   synchronized (mXWalkSettingsLock) {
     if (mAllowFileAccessFromFileURLs != flag) {
       mAllowFileAccessFromFileURLs = flag;
       mEventHandler.updateWebkitPreferencesLocked();
     }
   }
 }
示例#8
0
 /** 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();
     }
   }
 }
示例#9
0
 /** 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();
     }
   }
 }