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

Unified Diff: chrome/browser/chromeos/file_manager/file_tasks.h

Issue 686393002: Add isGenericFileHandler property to FileTask. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unitteset for IsGenericFileHandler. Created 6 years, 2 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/file_manager/file_tasks.h
diff --git a/chrome/browser/chromeos/file_manager/file_tasks.h b/chrome/browser/chromeos/file_manager/file_tasks.h
index 5f88d98b00f3e70a54fab2457bdec9ff360b4dee..2c10b7fa13ba4c5550bb7632eec416f0b25b1c63 100644
--- a/chrome/browser/chromeos/file_manager/file_tasks.h
+++ b/chrome/browser/chromeos/file_manager/file_tasks.h
@@ -104,7 +104,7 @@
// should be simplified: crbug.com/267313
//
// See also:
-// ui/file_manager/file_manager/js/file_tasks.js
+// ui/file_manager/file_manager/foreground/js/file_tasks.js
//
#ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_
@@ -166,7 +166,8 @@ class FullTaskDescriptor {
FullTaskDescriptor(const TaskDescriptor& task_descriptor,
const std::string& task_title,
const GURL& icon_url,
- bool is_default);
+ bool is_default,
+ bool is_generic_file_handler);
const TaskDescriptor& task_descriptor() const { return task_descriptor_; }
// The title of the task.
@@ -178,11 +179,21 @@ class FullTaskDescriptor {
bool is_default() const { return is_default_; }
void set_is_default(bool is_default) { is_default_ = is_default; }
+ // True if this task is from generic file handler. Generic file handler is a
+ // file handler which handles any type of files (e.g. extensions: ["*"],
+ // types: ["*/*"]). Partial wild card (e.g. types: ["image/*"]) is not
+ // generic file handler.
+ bool is_generic_file_handler() const { return is_generic_file_handler_; }
+ void set_is_generic_file_handler(bool is_generic_file_handler) {
+ is_generic_file_handler_ = is_generic_file_handler;
+ }
+
private:
TaskDescriptor task_descriptor_;
std::string task_title_;
GURL icon_url_;
bool is_default_;
+ bool is_generic_file_handler_;
};
// Update the default file handler for the given sets of suffixes and MIME
@@ -254,6 +265,9 @@ void FindDriveAppTasks(const drive::DriveAppRegistry& drive_app_registry,
const PathAndMimeTypeSet& path_mime_set,
std::vector<FullTaskDescriptor>* result_list);
+// Returns whether a file handler info is a generic file handler or not.
+bool IsGenericFileHandler(const extensions::FileHandlerInfo& file_handler_info);
+
// Finds the file handler tasks (apps declaring "file_handlers" in
// manifest.json) that can be used with the given files, appending them to
// the |result_list|.

Powered by Google App Engine
This is Rietveld 408576698