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

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.h

Issue 18331017: Support choosing multiple files with fileSystem.chooseEntry. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 5 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/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..88b1139f8b1902d1bd64606adbe479aa4899e7ad 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
+ // from FilesSelected, or from WritableFileCheckHelper. It is called on the UI
// thread.
Matt Giuca 2013/07/19 02:28:11 Describe |multiple|.
Sam McNally 2013/07/19 04:22:14 Done.
- void RegisterFileSystemAndSendResponse(const base::FilePath& path,
- EntryType entry_type);
+ 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_;

Powered by Google App Engine
This is Rietveld 408576698