| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/fileapi/browser_file_system_helper.h" | 5 #include "content/browser/fileapi/browser_file_system_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 FileSystemOptions::ProfileMode profile_mode = | 35 FileSystemOptions::ProfileMode profile_mode = |
| 36 is_incognito ? FileSystemOptions::PROFILE_MODE_INCOGNITO | 36 is_incognito ? FileSystemOptions::PROFILE_MODE_INCOGNITO |
| 37 : FileSystemOptions::PROFILE_MODE_NORMAL; | 37 : FileSystemOptions::PROFILE_MODE_NORMAL; |
| 38 std::vector<std::string> additional_allowed_schemes; | 38 std::vector<std::string> additional_allowed_schemes; |
| 39 GetContentClient()->browser()->GetAdditionalAllowedSchemesForFileSystem( | 39 GetContentClient()->browser()->GetAdditionalAllowedSchemesForFileSystem( |
| 40 &additional_allowed_schemes); | 40 &additional_allowed_schemes); |
| 41 if (CommandLine::ForCurrentProcess()->HasSwitch( | 41 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 42 switches::kAllowFileAccessFromFiles)) { | 42 switches::kAllowFileAccessFromFiles)) { |
| 43 additional_allowed_schemes.push_back(kFileScheme); | 43 additional_allowed_schemes.push_back(kFileScheme); |
| 44 } | 44 } |
| 45 return FileSystemOptions(profile_mode, additional_allowed_schemes); | 45 return FileSystemOptions(profile_mode, additional_allowed_schemes, NULL); |
| 46 } | 46 } |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext( | 50 scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext( |
| 51 BrowserContext* browser_context, | 51 BrowserContext* browser_context, |
| 52 const base::FilePath& profile_path, | 52 const base::FilePath& profile_path, |
| 53 bool is_incognito, | 53 bool is_incognito, |
| 54 quota::QuotaManagerProxy* quota_manager_proxy) { | 54 quota::QuotaManagerProxy* quota_manager_proxy) { |
| 55 | 55 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 context->operation_runner()->SyncGetPlatformPath(url, platform_path); | 121 context->operation_runner()->SyncGetPlatformPath(url, platform_path); |
| 122 | 122 |
| 123 // The path is to be attached to URLLoader so we grant read permission | 123 // The path is to be attached to URLLoader so we grant read permission |
| 124 // for the file. (We need to check first because a parent directory may | 124 // for the file. (We need to check first because a parent directory may |
| 125 // already have the permissions and we don't need to grant it to the file.) | 125 // already have the permissions and we don't need to grant it to the file.) |
| 126 if (!policy->CanReadFile(process_id, *platform_path)) | 126 if (!policy->CanReadFile(process_id, *platform_path)) |
| 127 policy->GrantReadFile(process_id, *platform_path); | 127 policy->GrantReadFile(process_id, *platform_path); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace content | 130 } // namespace content |
| OLD | NEW |