summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorHuahui Wu <hwu@google.com>2011-03-24 03:35:59 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-24 03:35:59 -0700
commit772f5bb1894710b0f0068d4f34e85ce38becc4b6 (patch)
tree4a497e5aa222732943a000b605b7e0228892beff /core
parent6f67e7bf831147257e078dd72a22f2e43e009122 (diff)
parentf440831d76817e837164ca18c7705e81d2391f87 (diff)
downloadframeworks_base-772f5bb1894710b0f0068d4f34e85ce38becc4b6.zip
frameworks_base-772f5bb1894710b0f0068d4f34e85ce38becc4b6.tar.gz
frameworks_base-772f5bb1894710b0f0068d4f34e85ce38becc4b6.tar.bz2
am f440831d: DO NOT MERGE
* commit 'f440831d76817e837164ca18c7705e81d2391f87': DO NOT MERGE
Diffstat (limited to 'core')
-rw-r--r--core/java/android/webkit/FrameLoader.java3
-rw-r--r--core/java/android/webkit/WebSettings.java23
2 files changed, 24 insertions, 2 deletions
diff --git a/core/java/android/webkit/FrameLoader.java b/core/java/android/webkit/FrameLoader.java
index 021b53c..4bc12d4 100644
--- a/core/java/android/webkit/FrameLoader.java
+++ b/core/java/android/webkit/FrameLoader.java
@@ -186,7 +186,8 @@ class FrameLoader {
settings.getAllowFileAccess())).sendToTarget();
}
return true;
- } else if (URLUtil.isContentUrl(url)) {
+ } else if (settings.getAllowContentAccess() &&
+ URLUtil.isContentUrl(url)) {
// Send the raw url to the ContentLoader because it will do a
// permission check and the url has to match.
if (loadListener.isSynchronous()) {
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index 4d70e7c..89e25e8 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -206,6 +206,7 @@ public class WebSettings {
private boolean mSupportZoom = true;
private boolean mBuiltInZoomControls = false;
private boolean mAllowFileAccess = true;
+ private boolean mAllowContentAccess = true;
private boolean mLoadWithOverviewMode = false;
private boolean mUseWebViewBackgroundOverscrollBackground = true;
@@ -458,7 +459,9 @@ public class WebSettings {
/**
* Enable or disable file access within WebView. File access is enabled by
- * default.
+ * default. Note that this enables or disables file system access only.
+ * Assets and resources are still accessible using file:///android_asset and
+ * file:///android_res.
*/
public void setAllowFileAccess(boolean allow) {
mAllowFileAccess = allow;
@@ -472,6 +475,24 @@ public class WebSettings {
}
/**
+ * Enable or disable content url access within WebView. Content url access
+ * allows WebView to load content from a content provider installed in the
+ * system. The default is enabled.
+ * @hide
+ */
+ public void setAllowContentAccess(boolean allow) {
+ mAllowContentAccess = allow;
+ }
+
+ /**
+ * Returns true if this WebView supports content url access.
+ * @hide
+ */
+ public boolean getAllowContentAccess() {
+ return mAllowContentAccess;
+ }
+
+ /**
* Set whether the WebView loads a page with overview mode.
*/
public void setLoadWithOverviewMode(boolean overview) {