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..eb1111d88aea2cd09bbf3e7057ba5133118a066c 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,44 @@ 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, |
benwells
2013/08/01 07:48:33
Nit: document both methods, and |multiple|.
Sam McNally
2013/08/02 05:35:31
Done.
|
+ 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); |
+ // This will finish the choose file process. This is called from |
+ // FileSystemIsRestorableFunction::RunImpl. This can be useful for creating a |
+ // file entry with an id matching another file entry, e.g. for restoreEntry. |
+ void RegisterFileSystemsAndSendResponseWithIdOverrides( |
+ const std::vector<std::pair<base::FilePath, std::string> >& |
+ paths_and_overrides, |
+ EntryType entry_type, |
+ bool multiple); |
+ |
+ base::DictionaryValue* BuildEntryDict(const base::FilePath& path, |
+ EntryType entry_type, |
+ const std::string& id); |
+ |
// 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 +121,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 +153,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_; |