summaryrefslogtreecommitdiffstats
path: root/chrome/browser/file_system
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 01:51:09 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 01:51:09 +0000
commit426c90ed5f2a6ea79639dc337be50b68393d4546 (patch)
treeaf3b6ac1056baeb8588996992fec03ace61a9987 /chrome/browser/file_system
parentcdf4005c98db0b4f7eda39b1df12070f0fb6f925 (diff)
downloadchromium_src-426c90ed5f2a6ea79639dc337be50b68393d4546.zip
chromium_src-426c90ed5f2a6ea79639dc337be50b68393d4546.tar.gz
chromium_src-426c90ed5f2a6ea79639dc337be50b68393d4546.tar.bz2
Hook up Cookies content settings for FileSystem API
This patch simply rejects requestFileSystem if cookie settings is set to BLOCK (no prompting). BUG=32277 TEST=none Review URL: http://codereview.chromium.org/3551011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/file_system')
-rw-r--r--chrome/browser/file_system/file_system_dispatcher_host.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/chrome/browser/file_system/file_system_dispatcher_host.cc b/chrome/browser/file_system/file_system_dispatcher_host.cc
index 6dd6072..df87b11 100644
--- a/chrome/browser/file_system/file_system_dispatcher_host.cc
+++ b/chrome/browser/file_system/file_system_dispatcher_host.cc
@@ -120,21 +120,25 @@ bool FileSystemDispatcherHost::OnMessageReceived(
void FileSystemDispatcherHost::OnOpenFileSystem(
int request_id, const GURL& origin_url, fileapi::FileSystemType type,
int64 requested_size) {
-
- // TODO(kinuko): hook up ContentSettings cookies type checks.
+ ContentSetting content_setting =
+ host_content_settings_map_->GetContentSetting(
+ origin_url, CONTENT_SETTINGS_TYPE_COOKIES, "");
+ DCHECK((content_setting == CONTENT_SETTING_ALLOW) ||
+ (content_setting == CONTENT_SETTING_BLOCK) ||
+ (content_setting == CONTENT_SETTING_SESSION_ONLY));
+ if (content_setting == CONTENT_SETTING_BLOCK) {
+ // TODO(kinuko): Need to notify the UI thread to indicate that
+ // there's a blocked content.
+ Send(new ViewMsg_OpenFileSystemRequest_Complete(
+ request_id, false, std::string(), FilePath()));
+ return;
+ }
FilePath root_path;
std::string name;
-
- if (!context_->GetFileSystemRootPath(origin_url,
- type,
- &root_path,
- &name)) {
+ if (!context_->GetFileSystemRootPath(origin_url, type, &root_path, &name)) {
Send(new ViewMsg_OpenFileSystemRequest_Complete(
- request_id,
- false,
- std::string(),
- FilePath()));
+ request_id, false, std::string(), FilePath()));
return;
}