Index: content/public/android/java/src/org/chromium/content/browser/ContentSettings.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java b/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java |
index 90e4d8de66edec1fe285bea8cd577a3d8ac6bf3e..76cc03e16ee8489212dcf1aa4442655f83c006eb 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java |
@@ -82,6 +82,8 @@ public class ContentSettings { |
private boolean mJavaScriptCanOpenWindowsAutomatically = false; |
private PluginState mPluginState = PluginState.OFF; |
private boolean mDomStorageEnabled = false; |
+ private boolean mAllowFileUrlAccess = true; |
+ private boolean mAllowContentUrlAccess = true; |
// Not accessed by the native side. |
private String mDefaultUserAgent = ""; |
@@ -301,6 +303,51 @@ public class ContentSettings { |
return mDisplayZoomControls; |
} |
+ /** |
+ * Enables or disables file access within ContentView. File access is enabled by |
+ * 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 synchronized void setAllowFileAccess(boolean allow) { |
+ assert mCanModifySettings; |
+ if (mAllowFileUrlAccess != allow) { |
+ mAllowFileUrlAccess = allow; |
+ sendSyncMessage(); |
+ } |
+ } |
+ |
+ /** |
+ * Gets whether this ContentView supports file access. |
+ * |
+ * @see #setAllowFileAccess |
+ */ |
+ public synchronized boolean getAllowFileAccess() { |
+ return mAllowFileUrlAccess; |
+ } |
+ |
+ /** |
+ * Enables or disables content URL access within ContentView. Content URL |
+ * access allows ContentView to load content from a content provider installed |
+ * in the system. The default is enabled. |
+ */ |
+ public synchronized void setAllowContentAccess(boolean allow) { |
+ assert mCanModifySettings; |
+ if (mAllowContentUrlAccess != allow) { |
+ mAllowContentUrlAccess = allow; |
+ sendSyncMessage(); |
+ } |
+ } |
+ |
+ /** |
+ * Gets whether this ContentView supports content URL access. |
+ * |
+ * @see #setAllowContentAccess |
+ */ |
+ public synchronized boolean getAllowContentAccess() { |
+ return mAllowContentUrlAccess; |
+ } |
+ |
boolean supportsMultiTouchZoom() { |
return mSupportZoom && mBuiltInZoomControls; |
} |