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

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

Issue 13415006: Do not refer "chrome" in content/browser/fileapi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 8 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/browser/fileapi/browser_file_system_helper.cc
diff --git a/content/browser/fileapi/browser_file_system_helper.cc b/content/browser/fileapi/browser_file_system_helper.cc
index 710c3bd9372c24e8ee031436fb973b718d0af400..485d96afcba2679de90537a0c45e218ab5f5f2d9 100644
--- a/content/browser/fileapi/browser_file_system_helper.cc
+++ b/content/browser/fileapi/browser_file_system_helper.cc
@@ -12,7 +12,10 @@
#include "base/threading/sequenced_worker_pool.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/content_browser_client.h"
+#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/url_constants.h"
#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_permission_policy.h"
#include "webkit/fileapi/file_system_options.h"
@@ -22,28 +25,26 @@
#include "webkit/quota/quota_manager.h"
namespace content {
-namespace {
-const char kChromeScheme[] = "chrome";
-const char kExtensionScheme[] = "chrome-extension";
+namespace {
using fileapi::FileSystemOptions;
FileSystemOptions CreateBrowserFileSystemOptions(bool is_incognito) {
+ FileSystemOptions::ProfileMode profile_mode =
+ is_incognito ? FileSystemOptions::PROFILE_MODE_INCOGNITO
+ : FileSystemOptions::PROFILE_MODE_NORMAL;
std::vector<std::string> additional_allowed_schemes;
- additional_allowed_schemes.push_back(kChromeScheme);
- additional_allowed_schemes.push_back(kExtensionScheme);
+ GetContentClient()->browser()->GetAdditionalAllowedSchemesForFileSystem(
+ &additional_allowed_schemes);
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAllowFileAccessFromFiles)) {
- additional_allowed_schemes.push_back("file");
+ additional_allowed_schemes.push_back(chrome::kFileScheme);
}
- FileSystemOptions::ProfileMode profile_mode =
- is_incognito ? FileSystemOptions::PROFILE_MODE_INCOGNITO
- : FileSystemOptions::PROFILE_MODE_NORMAL;
return FileSystemOptions(profile_mode, additional_allowed_schemes);
}
-} // anonymous namespace
+} // namespace
scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext(
const base::FilePath& profile_path, bool is_incognito,

Powered by Google App Engine
This is Rietveld 408576698