summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 18:15:30 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 18:15:30 +0000
commit45316d6f9cd510bd1b4604c38713272b2c8a7c9e (patch)
tree4055d1f19f436e9f1bf0d44a648e95e45b1e82d3 /chrome/renderer
parentfd59f820f28a384de8f880237979e7fe28854040 (diff)
downloadchromium_src-45316d6f9cd510bd1b4604c38713272b2c8a7c9e.zip
chromium_src-45316d6f9cd510bd1b4604c38713272b2c8a7c9e.tar.gz
chromium_src-45316d6f9cd510bd1b4604c38713272b2c8a7c9e.tar.bz2
Chrome side of having the WebKit FileSystem API use WebPermissionClient for checking if using file system is fine. Depends on https://bugs.webkit.org/show_bug.cgi?id=60683
BUG=76793 Review URL: http://codereview.chromium.org/7012007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85153 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/chrome_render_view_observer.cc4
-rw-r--r--chrome/renderer/chrome_render_view_observer.h5
-rw-r--r--chrome/renderer/content_settings_observer.cc11
-rw-r--r--chrome/renderer/content_settings_observer.h1
4 files changed, 19 insertions, 2 deletions
diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc
index 9bdb65e..e05503b 100644
--- a/chrome/renderer/chrome_render_view_observer.cc
+++ b/chrome/renderer/chrome_render_view_observer.cc
@@ -301,6 +301,10 @@ bool ChromeRenderViewObserver::allowDatabase(
frame, name, display_name, estimated_size);
}
+bool ChromeRenderViewObserver::allowFileSystem(WebFrame* frame) {
+ return content_settings_->AllowFileSystem(frame);
+}
+
bool ChromeRenderViewObserver::allowImages(WebFrame* frame,
bool enabled_per_settings) {
return content_settings_->AllowImages(frame, enabled_per_settings);
diff --git a/chrome/renderer/chrome_render_view_observer.h b/chrome/renderer/chrome_render_view_observer.h
index 7ead50f..863a5b9 100644
--- a/chrome/renderer/chrome_render_view_observer.h
+++ b/chrome/renderer/chrome_render_view_observer.h
@@ -69,12 +69,13 @@ class ChromeRenderViewObserver : public RenderViewObserver,
const WebKit::WebString& name,
const WebKit::WebString& display_name,
unsigned long estimated_size) OVERRIDE;
+ // TODO(jam): add OVERRIDE once WebKit is rolled.
+ virtual bool allowFileSystem(WebKit::WebFrame* frame);
virtual bool allowImages(WebKit::WebFrame* frame,
bool enabled_per_settings) OVERRIDE;
- // TODO(jam): add OVERRIDE once WebKit is rolled.
virtual bool allowIndexedDB(WebKit::WebFrame* frame,
const WebKit::WebString& name,
- const WebKit::WebSecurityOrigin& origin);
+ const WebKit::WebSecurityOrigin& origin) OVERRIDE;
virtual bool allowPlugins(WebKit::WebFrame* frame,
bool enabled_per_settings) OVERRIDE;
virtual bool allowScript(WebKit::WebFrame* frame,
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index ec51b8b..d9ebc24 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -145,6 +145,17 @@ bool ContentSettingsObserver::AllowDatabase(WebFrame* frame,
return result;
}
+bool ContentSettingsObserver::AllowFileSystem(WebFrame* frame) {
+ WebSecurityOrigin origin = frame->securityOrigin();
+ if (origin.isEmpty())
+ return false; // Uninitialized document?
+
+ bool result = false;
+ Send(new ViewHostMsg_AllowFileSystem(
+ routing_id(), GURL(origin.toString()), &result));
+ return result;
+}
+
bool ContentSettingsObserver::AllowImages(WebFrame* frame,
bool enabled_per_settings) {
if (enabled_per_settings &&
diff --git a/chrome/renderer/content_settings_observer.h b/chrome/renderer/content_settings_observer.h
index 9221a7f..2cc548d 100644
--- a/chrome/renderer/content_settings_observer.h
+++ b/chrome/renderer/content_settings_observer.h
@@ -45,6 +45,7 @@ class ContentSettingsObserver
const WebKit::WebString& name,
const WebKit::WebString& display_name,
unsigned long estimated_size);
+ bool AllowFileSystem(WebKit::WebFrame* frame);
bool AllowImages(WebKit::WebFrame* frame, bool enabled_per_settings);
bool AllowIndexedDB(WebKit::WebFrame* frame,
const WebKit::WebString& name,