Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / file_manager / file_tasks.h
index 5f88d98..2c10b7f 100644 (file)
 // 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|.