Commit 3563c312 authored by benwells@chromium.org's avatar benwells@chromium.org

[cros] Remove file manager code for WebIntents file tasks.

Apps cannot handle files via WebIntents declarations anymore.

BUG=173194


Review URL: https://chromiumcodereview.appspot.com/12218136

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182329 0039d316-1c4b-4281-b951-d872f2087c98
parent 2430e24b
...@@ -55,7 +55,6 @@ namespace file_handler_util { ...@@ -55,7 +55,6 @@ namespace file_handler_util {
const char kTaskFile[] = "file"; const char kTaskFile[] = "file";
const char kTaskDrive[] = "drive"; const char kTaskDrive[] = "drive";
const char kTaskWebIntent[] = "web-intent";
const char kTaskApp[] = "app"; const char kTaskApp[] = "app";
namespace { namespace {
...@@ -270,7 +269,6 @@ std::string MakeTaskID(const std::string& extension_id, ...@@ -270,7 +269,6 @@ std::string MakeTaskID(const std::string& extension_id,
const std::string& action_id) { const std::string& action_id) {
DCHECK(task_type == kTaskFile || DCHECK(task_type == kTaskFile ||
task_type == kTaskDrive || task_type == kTaskDrive ||
task_type == kTaskWebIntent ||
task_type == kTaskApp); task_type == kTaskApp);
return base::StringPrintf("%s|%s|%s", return base::StringPrintf("%s|%s|%s",
extension_id.c_str(), extension_id.c_str(),
...@@ -321,7 +319,6 @@ bool CrackTaskID(const std::string& task_id, ...@@ -321,7 +319,6 @@ bool CrackTaskID(const std::string& task_id,
*task_type = result[1]; *task_type = result[1];
DCHECK(*task_type == kTaskFile || DCHECK(*task_type == kTaskFile ||
*task_type == kTaskDrive || *task_type == kTaskDrive ||
*task_type == kTaskWebIntent ||
*task_type == kTaskApp); *task_type == kTaskApp);
} }
...@@ -542,27 +539,6 @@ class ExtensionTaskExecutor : public FileTaskExecutor { ...@@ -542,27 +539,6 @@ class ExtensionTaskExecutor : public FileTaskExecutor {
FileTaskFinishedCallback done_; FileTaskFinishedCallback done_;
}; };
class WebIntentTaskExecutor : public FileTaskExecutor {
public:
// FileTaskExecutor overrides.
virtual bool ExecuteAndNotify(const std::vector<FileSystemURL>& file_urls,
const FileTaskFinishedCallback& done) OVERRIDE;
private:
// FileTaskExecutor is the only class allowed to create one.
friend class FileTaskExecutor;
WebIntentTaskExecutor(Profile* profile,
const GURL& source_url,
const std::string& file_browser_id,
const std::string& extension_id,
const std::string& action_id);
virtual ~WebIntentTaskExecutor();
const std::string extension_id_;
const std::string action_id_;
};
class AppTaskExecutor : public FileTaskExecutor { class AppTaskExecutor : public FileTaskExecutor {
public: public:
// FileTaskExecutor overrides. // FileTaskExecutor overrides.
...@@ -605,13 +581,6 @@ FileTaskExecutor* FileTaskExecutor::Create(Profile* profile, ...@@ -605,13 +581,6 @@ FileTaskExecutor* FileTaskExecutor::Create(Profile* profile,
extension_id, // really app_id extension_id, // really app_id
action_id); action_id);
if (task_type == kTaskWebIntent)
return new WebIntentTaskExecutor(profile,
source_url,
file_browser_id,
extension_id,
action_id);
if (task_type == kTaskApp) if (task_type == kTaskApp)
return new AppTaskExecutor(profile, return new AppTaskExecutor(profile,
source_url, source_url,
...@@ -1012,35 +981,6 @@ void ExtensionTaskExecutor::SetupHandlerHostFileAccessPermissions( ...@@ -1012,35 +981,6 @@ void ExtensionTaskExecutor::SetupHandlerHostFileAccessPermissions(
} }
} }
WebIntentTaskExecutor::WebIntentTaskExecutor(
Profile* profile,
const GURL& source_url,
const std::string& file_browser_id,
const std::string& extension_id,
const std::string& action_id)
: FileTaskExecutor(profile, source_url, file_browser_id, extension_id),
action_id_(action_id) {
}
WebIntentTaskExecutor::~WebIntentTaskExecutor() {}
bool WebIntentTaskExecutor::ExecuteAndNotify(
const std::vector<FileSystemURL>& file_urls,
const FileTaskFinishedCallback& done) {
if (!FileBrowserHasAccessPermissionForFiles(file_urls))
return false;
for (size_t i = 0; i != file_urls.size(); ++i) {
extensions::LaunchPlatformAppWithPath(profile(), GetExtension(),
file_urls[i].path());
}
if (!done.is_null())
done.Run(true);
return true;
}
AppTaskExecutor::AppTaskExecutor( AppTaskExecutor::AppTaskExecutor(
Profile* profile, Profile* profile,
const GURL& source_url, const GURL& source_url,
......
...@@ -32,7 +32,6 @@ namespace file_handler_util { ...@@ -32,7 +32,6 @@ namespace file_handler_util {
// action, or Web Intent action. // action, or Web Intent action.
extern const char kTaskFile[]; extern const char kTaskFile[];
extern const char kTaskDrive[]; extern const char kTaskDrive[];
extern const char kTaskWebIntent[];
extern const char kTaskApp[]; extern const char kTaskApp[];
void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id); void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id);
...@@ -58,7 +57,7 @@ int GetReadWritePermissions(); ...@@ -58,7 +57,7 @@ int GetReadWritePermissions();
int GetReadOnlyPermissions(); int GetReadOnlyPermissions();
// Generates task id for the action specified by the extension. The |task_type| // Generates task id for the action specified by the extension. The |task_type|
// must be one of kTaskFile, kTaskDrive, or kTaskWebIntent. // must be one of kTaskFile, kTaskDrive or kTaskApp.
std::string MakeTaskID(const std::string& extension_id, std::string MakeTaskID(const std::string& extension_id,
const std::string& task_type, const std::string& task_type,
const std::string& action_id); const std::string& action_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment