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

Unified Diff: content/browser/file_system/browser_file_system_helper.cc

Issue 9004019: Cleanup: Removing FileSystemPathManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 12 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
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/file_system/browser_file_system_helper.cc
diff --git a/content/browser/file_system/browser_file_system_helper.cc b/content/browser/file_system/browser_file_system_helper.cc
index 4161cad7d985121c72aabbf270526bca1ccc601c..e1a7a8182815edf203d70cd3befd5efdb68e1ce2 100644
--- a/content/browser/file_system/browser_file_system_helper.cc
+++ b/content/browser/file_system/browser_file_system_helper.cc
@@ -4,14 +4,41 @@
#include "content/browser/file_system/browser_file_system_helper.h"
+#include <vector>
+#include <string>
+
#include "base/command_line.h"
#include "base/file_path.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
+#include "webkit/fileapi/file_system_options.h"
#include "webkit/quota/quota_manager.h"
using content::BrowserThread;
+namespace {
+
+const char kChromeScheme[] = "chrome";
+const char kExtensionScheme[] = "chrome-extension";
+
+using fileapi::FileSystemOptions;
+
+FileSystemOptions CreateBrowserFileSystemOptions(bool is_incognito) {
+ std::vector<std::string> additional_allowed_schemes;
+ additional_allowed_schemes.push_back(kChromeScheme);
+ additional_allowed_schemes.push_back(kExtensionScheme);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAllowFileAccessFromFiles)) {
+ additional_allowed_schemes.push_back("file");
+ }
+ FileSystemOptions::ProfileMode profile_mode =
+ is_incognito ? FileSystemOptions::PROFILE_MODE_INCOGNITO
+ : FileSystemOptions::PROFILE_MODE_NORMAL;
+ return FileSystemOptions(profile_mode, additional_allowed_schemes);
+}
+
+} // anonymous namespace
+
scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext(
const FilePath& profile_path, bool is_incognito,
quota::SpecialStoragePolicy* special_storage_policy,
@@ -22,8 +49,5 @@ scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext(
special_storage_policy,
quota_manager_proxy,
profile_path,
- is_incognito,
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAllowFileAccessFromFiles),
- NULL);
+ CreateBrowserFileSystemOptions(is_incognito));
}
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698