diff options
author | Selim Gurun <sgurun@google.com> | 2012-04-19 17:01:21 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-04-19 17:01:21 -0700 |
commit | caf7f3d1fc28f74f0782438cd5a91aef7a9dedb5 (patch) | |
tree | 686abd1a18733cb140aa147dfcfc2de92b78fe06 /core/java/android/webkit/WebSettings.java | |
parent | f0c4c658488824707c206551fd1ccc0a0781031e (diff) | |
parent | 0ea6dad65eb77f9347a59704b1f8a019cfc9e01f (diff) | |
download | frameworks_base-caf7f3d1fc28f74f0782438cd5a91aef7a9dedb5.zip frameworks_base-caf7f3d1fc28f74f0782438cd5a91aef7a9dedb5.tar.gz frameworks_base-caf7f3d1fc28f74f0782438cd5a91aef7a9dedb5.tar.bz2 |
Merge "Add websettings API for file origin policy."
Diffstat (limited to 'core/java/android/webkit/WebSettings.java')
-rw-r--r-- | core/java/android/webkit/WebSettings.java | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index ba48da1..4cd828e 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -17,6 +17,7 @@ package android.webkit; import android.os.Message; +import android.os.Build; /** * Manages settings state for a WebView. When a WebView is first created, it @@ -29,7 +30,7 @@ import android.os.Message; // This is (effectively) an abstract base class; concrete WebViewProviders must // create a class derived from this, and return an instance of it in the // WebViewProvider.getWebSettingsProvider() method implementation. -public class WebSettings { +public abstract class WebSettings { // TODO: Remove MustOverrideException and make all methods throwing it abstract instead; // needs API file update. private static class MustOverrideException extends RuntimeException { @@ -771,6 +772,29 @@ public class WebSettings { } /** + * Configure scripting (such as XmlHttpRequest) access from file scheme URLs + * to any origin. Note, calling this method with a true argument value also + * implies calling setAllowFileAccessFromFileURLs with a true. The default + * value is false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN} + * and higher and true otherwise. + * + . * @param flag True if the WebView should allow scripting access from file + * scheme URLs to any origin + */ + public abstract void setAllowUniversalAccessFromFileURLs(boolean flag); + + /** + * Configure scripting (such as XmlHttpRequest) access from file scheme URLs + * to file origin. The default value is false for API level + * {@link android.os.Build.VERSION_CODES#JELLY_BEAN} and higher and true + * otherwise. + * + * @param flag True if the WebView should allow scripting access from file + * scheme URLs to file origin + */ + public abstract void setAllowFileAccessFromFileURLs(boolean flag); + + /** * Tell the WebView to enable plugins. * @param flag True if the WebView should load plugins. * @deprecated This method has been deprecated in favor of @@ -912,6 +936,26 @@ public class WebSettings { } /** + * Return true if scripting access {see @setAllowUniversalAccessFromFileURLs} from + * file URLs to any origin is enabled. The default value is false for API level + * {@link android.os.Build.VERSION_CODES#JELLY_BEAN} and higher and true otherwise. + * + * @return True if the WebView allows scripting access from file scheme requests + * to any origin + */ + public abstract boolean getAllowUniversalAccessFromFileURLs(); + + /** + * Return true if scripting access {see @setAllowFileAccessFromFileURLs} from file + * URLs to file origin is enabled. The default value is false for API level + * {@link android.os.Build.VERSION_CODES#JELLY_BEAN} and higher, and true otherwise. + * + * @return True if the WebView allows scripting access from file scheme requests + * to file origin + */ + public abstract boolean getAllowFileAccessFromFileURLs(); + + /** * Return true if plugins are enabled. * @return True if plugins are enabled. * @deprecated This method has been replaced by {@link #getPluginState} |