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

Unified Diff: chrome/browser/chromeos/extensions/file_manager_util.cc

Issue 11787028: New FileSystemURL cracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Couple of nits I noticed Created 7 years, 11 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/chromeos/extensions/file_manager_util.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager_util.cc b/chrome/browser/chromeos/extensions/file_manager_util.cc
index 55fba96316b14297d01f94065530cd60285e9aaa..5b8888bcca08209469042ba743a1a79447b47c96 100644
--- a/chrome/browser/chromeos/extensions/file_manager_util.cc
+++ b/chrome/browser/chromeos/extensions/file_manager_util.cc
@@ -54,6 +54,7 @@
#include "ui/gfx/screen.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_mount_point_provider.h"
+#include "webkit/fileapi/file_system_url.h"
#include "webkit/fileapi/file_system_util.h"
#include "webkit/plugins/webplugininfo.h"
@@ -65,6 +66,7 @@ using content::PluginService;
using content::UserMetricsAction;
using extensions::Extension;
using file_handler_util::FileTaskExecutor;
+using fileapi::FileSystemURL;
#define FILEBROWSER_EXTENSON_ID "hhaomjibdihmijegdhdafkllkbggdgoj"
const char kFileBrowserDomain[] = FILEBROWSER_EXTENSON_ID;
@@ -481,15 +483,17 @@ void ExecuteHandler(Profile* profile,
// site for which file access permissions should be granted.
GURL site = extensions::ExtensionSystem::Get(profile)->extension_service()->
GetSiteForExtensionId(kFileBrowserDomain);
- fileapi::ExternalFileSystemMountPointProvider* external_provider =
+ fileapi::FileSystemContext* file_system_context =
BrowserContext::GetStoragePartitionForSite(profile, site)->
- GetFileSystemContext()->external_provider();
- if (!external_provider)
+ GetFileSystemContext();
+
+ if (!file_system_context->external_provider())
return;
- external_provider->GrantFullAccessToExtension(source_url.host());
+ file_system_context->external_provider()->GrantFullAccessToExtension(
+ source_url.host());
- std::vector<GURL> urls;
- urls.push_back(url);
+ std::vector<FileSystemURL> urls;
+ urls.push_back(file_system_context->CrackURL(url));
scoped_refptr<FileTaskExecutor> executor = FileTaskExecutor::Create(profile,
source_url, kFileBrowserDomain, 0 /* no tab id */, extension_id,
file_handler_util::kTaskFile, action_id);
@@ -621,7 +625,7 @@ bool ExecuteDefaultHandler(Profile* profile, const FilePath& path) {
return false;
const FileBrowserHandler* handler;
- if (!file_handler_util::GetTaskForURL(profile, url, &handler))
+ if (!file_handler_util::GetTaskForURLAndPath(profile, url, path, &handler))
return false;
std::string extension_id = handler->extension_id();

Powered by Google App Engine
This is Rietveld 408576698