| Index: chrome/browser/extensions/api/file_system/file_system_api.h
|
| diff --git a/chrome/browser/extensions/api/file_system/file_system_api.h b/chrome/browser/extensions/api/file_system/file_system_api.h
|
| index 97b8dd1a8446f121e1734cfa6f4701bf80374f23..cae1e63d3e31501e47b3ccd9d4cb31517bf6a99e 100644
|
| --- a/chrome/browser/extensions/api/file_system/file_system_api.h
|
| +++ b/chrome/browser/extensions/api/file_system/file_system_api.h
|
| @@ -57,27 +57,37 @@ class FileSystemEntryFunction : public AsyncExtensionFunction {
|
| // This is called when a writable file entry is being returned. The function
|
| // will ensure the file exists, creating it if necessary, and also check that
|
| // the file is not a link. If it succeeds it proceeds to
|
| - // RegisterFileSystemAndSendResponse, otherwise to HandleWritableFileError.
|
| + // RegisterFileSystemsAndSendResponse, otherwise to HandleWritableFileError.
|
| void CheckWritableFile(const base::FilePath& path);
|
| + void CheckWritableFiles(const std::vector<base::FilePath>& path,
|
| + bool multiple);
|
|
|
| // This will finish the choose file process. This is either called directly
|
| - // from FileSelected, or from CreateFileIfNecessary. It is called on the UI
|
| - // thread.
|
| - void RegisterFileSystemAndSendResponse(const base::FilePath& path,
|
| - EntryType entry_type);
|
| + // from FilesSelected, or from WritableFileCheckHelper. It is called on the UI
|
| + // thread. |multiple| should be true if multiple files were requested.
|
| + void RegisterFileSystemsAndSendResponse(
|
| + const std::vector<base::FilePath>& path,
|
| + EntryType entry_type,
|
| + bool multiple);
|
|
|
| - // This will finish the choose file process. This is either called directly
|
| - // from FileSelected, or from CreateFileIfNecessary. It is called on the UI
|
| - // thread. |id_override| specifies the id to send in the response instead of
|
| - // the generated id. This can be useful for creating a file entry with an id
|
| - // matching another file entry, e.g. for restoreEntry.
|
| + // This will finish the choose file process. This is called from
|
| + // FileSystemIsRestorableFunction::RunImpl. |id_override| specifies the id to
|
| + // send in the response instead of the generated id. This can be useful for
|
| + // creating a file entry with an id matching another file entry, e.g. for
|
| + // restoreEntry.
|
| void RegisterFileSystemAndSendResponseWithIdOverride(
|
| const base::FilePath& path,
|
| EntryType entry_type,
|
| const std::string& id_override);
|
|
|
| + base::DictionaryValue* BuildEntryDictWithIdOverride(
|
| + const base::FilePath& path, EntryType entry_type, const std::string& id);
|
| +
|
| + base::DictionaryValue* BuildEntryDict(const base::FilePath& path,
|
| + EntryType entry_type);
|
| +
|
| // called on the UI thread if there is a problem checking a writable file.
|
| - void HandleWritableFileError();
|
| + void HandleWritableFileError(const std::string& error);
|
| };
|
|
|
| class FileSystemGetWritableEntryFunction : public FileSystemEntryFunction {
|
| @@ -104,6 +114,8 @@ class FileSystemChooseEntryFunction : public FileSystemEntryFunction {
|
| public:
|
| // Allow picker UI to be skipped in testing.
|
| static void SkipPickerAndAlwaysSelectPathForTest(base::FilePath* path);
|
| + static void SkipPickerAndAlwaysSelectPathsForTest(
|
| + std::vector<base::FilePath>* paths);
|
| static void SkipPickerAndSelectSuggestedPathForTest();
|
| static void SkipPickerAndAlwaysCancelForTest();
|
| static void StopSkippingPickerForTest();
|
| @@ -134,14 +146,17 @@ class FileSystemChooseEntryFunction : public FileSystemEntryFunction {
|
| virtual bool RunImpl() OVERRIDE;
|
| void ShowPicker(const ui::SelectFileDialog::FileTypeInfo& file_type_info,
|
| ui::SelectFileDialog::Type picker_type,
|
| - EntryType entry_type);
|
| + EntryType entry_type,
|
| + bool multiple);
|
|
|
| private:
|
| void SetInitialPathOnFileThread(const base::FilePath& suggested_name,
|
| const base::FilePath& previous_path);
|
|
|
| - // FileSelected and FileSelectionCanceled are called by the file picker.
|
| - void FileSelected(const base::FilePath& path, EntryType entry_type);
|
| + // FilesSelected and FileSelectionCanceled are called by the file picker.
|
| + void FilesSelected(const std::vector<base::FilePath>& path,
|
| + EntryType entry_type,
|
| + bool multiple);
|
| void FileSelectionCanceled();
|
|
|
| base::FilePath initial_path_;
|
|
|