Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentSettings.java

Issue 10827380: [Android] Implement WebSettings.{get|set}Allow{Content|File}Access. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..02d0fcd40d71f72ad6927b2d2e4b61887df50c7b 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 mAllowFileAccess = true;
+ private boolean mAllowContentAccess = 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 (mAllowFileAccess != allow) {
+ mAllowFileAccess = allow;
+ sendSyncMessage();
+ }
+ }
+
+ /**
+ * Gets whether this ContentView supports file access.
+ *
+ * @see #setAllowFileAccess
+ */
+ public synchronized boolean getAllowFileAccess() {
+ return mAllowFileAccess;
+ }
+
+ /**
+ * 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 (mAllowContentAccess != allow) {
+ mAllowContentAccess = allow;
+ sendSyncMessage();
+ }
+ }
+
+ /**
+ * Gets whether this ContentView supports content URL access.
+ *
+ * @see #setAllowContentAccess
+ */
+ public synchronized boolean getAllowContentAccess() {
+ return mAllowContentAccess;
+ }
+
boolean supportsMultiTouchZoom() {
return mSupportZoom && mBuiltInZoomControls;
}
« content/browser/android/content_settings.cc ('K') | « content/browser/android/content_settings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698