Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / file_manager / fileapi_util.h
index 8d05277..3756c7b 100644 (file)
@@ -18,6 +18,7 @@
 class Profile;
 
 namespace content {
+struct FileChooserFileInfo;
 class RenderViewHost;
 }
 
@@ -25,6 +26,10 @@ namespace storage {
 class FileSystemContext;
 }
 
+namespace ui {
+struct SelectedFileInfo;
+}
+
 namespace file_manager {
 namespace util {
 
@@ -52,6 +57,8 @@ struct EntryDefinition {
 
 typedef std::vector<FileDefinition> FileDefinitionList;
 typedef std::vector<EntryDefinition> EntryDefinitionList;
+typedef std::vector<ui::SelectedFileInfo> SelectedFileInfoList;
+typedef std::vector<content::FileChooserFileInfo> FileChooserFileInfoList;
 
 // The callback used by ConvertFileDefinitionToEntryDefinition. Returns the
 // result of the conversion.
@@ -63,6 +70,12 @@ typedef base::Callback<void(const EntryDefinition& entry_definition)>
 typedef base::Callback<void(scoped_ptr<
     EntryDefinitionList> entry_definition_list)> EntryDefinitionListCallback;
 
+// The callback used by
+// ConvertFileSelectedInfoListToFileChooserFileInfoList. Returns the result of
+// the conversion as a list.
+typedef base::Callback<void(const FileChooserFileInfoList&)>
+    FileChooserFileInfoListCallback;
+
 // Returns a file system context associated with the given profile and the
 // extension ID.
 storage::FileSystemContext* GetFileSystemContextForExtensionId(
@@ -125,12 +138,26 @@ void ConvertFileDefinitionListToEntryDefinitionList(
     const FileDefinitionList& file_definition_list,
     const EntryDefinitionListCallback& callback);
 
+// Converts SelectedFileInfoList into FileChooserFileInfoList.
+void ConvertSelectedFileInfoListToFileChooserFileInfoList(
+    storage::FileSystemContext* context,
+    const GURL& origin,
+    const SelectedFileInfoList& selected_info_list,
+    const FileChooserFileInfoListCallback& callback);
+
 // Checks if a directory exists at |url|.
 void CheckIfDirectoryExists(
     scoped_refptr<storage::FileSystemContext> file_system_context,
     const GURL& url,
     const storage::FileSystemOperationRunner::StatusCallback& callback);
 
+// Obtains isolated file system URL from |virtual_path| pointing a file in the
+// external file system.
+storage::FileSystemURL CreateIsolatedURLFromVirtualPath(
+    const storage::FileSystemContext& context,
+    const GURL& origin,
+    const base::FilePath& virtual_path);
+
 }  // namespace util
 }  // namespace file_manager