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

Unified Diff: chrome/browser/extensions/extension_file_browser_private_api.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
Index: chrome/browser/extensions/extension_file_browser_private_api.cc
diff --git a/chrome/browser/extensions/extension_file_browser_private_api.cc b/chrome/browser/extensions/extension_file_browser_private_api.cc
index 2c8b0b122142c70ec27b8b171a3b50da311e1dda..82cead992267af27ae51706ba9d002623ce4bbd0 100644
--- a/chrome/browser/extensions/extension_file_browser_private_api.cc
+++ b/chrome/browser/extensions/extension_file_browser_private_api.cc
@@ -47,7 +47,6 @@
#include "webkit/fileapi/file_system_mount_point_provider.h"
#include "webkit/fileapi/file_system_operation.h"
#include "webkit/fileapi/file_system_operation_context.h"
-#include "webkit/fileapi/file_system_path_manager.h"
#include "webkit/fileapi/file_system_types.h"
#include "webkit/fileapi/file_system_util.h"
@@ -383,10 +382,8 @@ class RequestLocalFileSystemFunction::LocalFileSystemCallbackDispatcher
return false;
}
- fileapi::FileSystemPathManager* path_manager =
- profile_->GetFileSystemContext()->path_manager();
fileapi::ExternalFileSystemMountPointProvider* provider =
- path_manager->external_provider();
+ profile_->GetFileSystemContext()->external_provider();
if (!provider)
return false;
@@ -465,8 +462,6 @@ void RequestLocalFileSystemFunction::RespondFailedOnUIThread(
bool FileWatchBrowserFunctionBase::GetLocalFilePath(
const GURL& file_url, FilePath* local_path, FilePath* virtual_path) {
- fileapi::FileSystemPathManager* path_manager =
- profile_->GetFileSystemContext()->path_manager();
GURL file_origin_url;
fileapi::FileSystemType type;
if (!CrackFileSystemURL(file_url, &file_origin_url, &type,
@@ -476,8 +471,8 @@ bool FileWatchBrowserFunctionBase::GetLocalFilePath(
if (type != fileapi::kFileSystemTypeExternal)
return false;
- FilePath root_path =
- path_manager->ValidateFileSystemRootAndGetPathOnFileThread(
+ FilePath root_path = profile_->GetFileSystemContext()->external_provider()->
+ ValidateFileSystemRootAndGetPathOnFileThread(
file_origin_url,
fileapi::kFileSystemTypeExternal,
*virtual_path,
@@ -745,11 +740,14 @@ class ExecuteTasksFileBrowserFunction::ExecuteTasksFileSystemCallbackDispatcher
if (type != fileapi::kFileSystemTypeExternal)
return false;
- fileapi::FileSystemPathManager* path_manager =
- profile_->GetFileSystemContext()->path_manager();
- if (!path_manager->IsAccessAllowed(file_origin_url,
- type,
- virtual_path)) {
+ fileapi::ExternalFileSystemMountPointProvider* external_provider =
+ profile_->GetFileSystemContext()->external_provider();
+ if (!external_provider)
+ return false;
+
+ if (!external_provider->IsAccessAllowed(file_origin_url,
+ type,
+ virtual_path)) {
return false;
}
@@ -760,18 +758,13 @@ class ExecuteTasksFileBrowserFunction::ExecuteTasksFileSystemCallbackDispatcher
}
FilePath root_path =
- path_manager->ValidateFileSystemRootAndGetPathOnFileThread(
+ external_provider->ValidateFileSystemRootAndGetPathOnFileThread(
file_origin_url,
fileapi::kFileSystemTypeExternal,
virtual_path,
false); // create
FilePath final_file_path = root_path.Append(virtual_path);
- fileapi::ExternalFileSystemMountPointProvider* external_provider =
- path_manager->external_provider();
- if (!external_provider)
- return false;
-
// Check if this file system entry exists first.
base::PlatformFileInfo file_info;
@@ -1012,10 +1005,16 @@ void FileBrowserFunction::GetLocalPathsOnFileThread(
// FilePath(virtual_path) doesn't work on win, so limit this to ChromeOS.
#if defined(OS_CHROMEOS)
- GURL origin_url = source_url().GetOrigin();
- fileapi::FileSystemPathManager* path_manager =
- profile()->GetFileSystemContext()->path_manager();
+ fileapi::ExternalFileSystemMountPointProvider* provider =
+ profile_->GetFileSystemContext()->external_provider();
+ if (!provider) {
+ LOG(WARNING) << "External provider is not available";
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(callback, selected_files));
+ return;
+ }
+ GURL origin_url = source_url().GetOrigin();
size_t len = file_urls.size();
selected_files.reserve(len);
for (size_t i = 0; i < len; ++i) {
@@ -1031,7 +1030,7 @@ void FileBrowserFunction::GetLocalPathsOnFileThread(
NOTREACHED();
continue;
}
- FilePath root = path_manager->ValidateFileSystemRootAndGetPathOnFileThread(
+ FilePath root = provider->ValidateFileSystemRootAndGetPathOnFileThread(
origin_url,
fileapi::kFileSystemTypeExternal,
FilePath(virtual_path),
« no previous file with comments | « chrome/browser/browsing_data_remover_unittest.cc ('k') | chrome/browser/extensions/extension_file_browser_private_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698