| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
| 9 #include "chrome/browser/ui/select_file_dialog.h" | 9 #include "chrome/browser/ui/select_file_dialog.h" |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 class FileSystemGetWritableFileEntryFunction : public FileSystemEntryFunction { | 48 class FileSystemGetWritableFileEntryFunction : public FileSystemEntryFunction { |
| 49 public: | 49 public: |
| 50 DECLARE_EXTENSION_FUNCTION_NAME("fileSystem.getWritableFileEntry"); | 50 DECLARE_EXTENSION_FUNCTION_NAME("fileSystem.getWritableFileEntry"); |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 virtual ~FileSystemGetWritableFileEntryFunction() {} | 53 virtual ~FileSystemGetWritableFileEntryFunction() {} |
| 54 virtual bool RunImpl() OVERRIDE; | 54 virtual bool RunImpl() OVERRIDE; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 class FileSystemIsWritableFileEntryFunction : public SyncExtensionFunction { |
| 58 public: |
| 59 DECLARE_EXTENSION_FUNCTION_NAME("fileSystem.isWritableFileEntry"); |
| 60 |
| 61 protected: |
| 62 virtual ~FileSystemIsWritableFileEntryFunction() {} |
| 63 virtual bool RunImpl() OVERRIDE; |
| 64 }; |
| 65 |
| 57 class FileSystemChooseFileFunction : public FileSystemEntryFunction { | 66 class FileSystemChooseFileFunction : public FileSystemEntryFunction { |
| 58 public: | 67 public: |
| 59 // Allow picker UI to be skipped in testing. | 68 // Allow picker UI to be skipped in testing. |
| 60 static void SkipPickerAndAlwaysSelectPathForTest(FilePath* path); | 69 static void SkipPickerAndAlwaysSelectPathForTest(FilePath* path); |
| 61 static void SkipPickerAndAlwaysCancelForTest(); | 70 static void SkipPickerAndAlwaysCancelForTest(); |
| 62 static void StopSkippingPickerForTest(); | 71 static void StopSkippingPickerForTest(); |
| 63 | 72 |
| 64 DECLARE_EXTENSION_FUNCTION_NAME("fileSystem.chooseFile"); | 73 DECLARE_EXTENSION_FUNCTION_NAME("fileSystem.chooseFile"); |
| 65 | 74 |
| 66 protected: | 75 protected: |
| 67 class FilePicker; | 76 class FilePicker; |
| 68 | 77 |
| 69 virtual ~FileSystemChooseFileFunction() {} | 78 virtual ~FileSystemChooseFileFunction() {} |
| 70 virtual bool RunImpl() OVERRIDE; | 79 virtual bool RunImpl() OVERRIDE; |
| 71 bool ShowPicker(const FilePath& suggested_path, | 80 bool ShowPicker(const FilePath& suggested_path, |
| 72 SelectFileDialog::Type picker_type, | 81 SelectFileDialog::Type picker_type, |
| 73 EntryType entry_type); | 82 EntryType entry_type); |
| 74 | 83 |
| 75 private: | 84 private: |
| 76 // FileSelected and FileSelectionCanceled are called by the file picker. | 85 // FileSelected and FileSelectionCanceled are called by the file picker. |
| 77 void FileSelected(const FilePath& path, EntryType entry_type); | 86 void FileSelected(const FilePath& path, EntryType entry_type); |
| 78 void FileSelectionCanceled(); | 87 void FileSelectionCanceled(); |
| 79 }; | 88 }; |
| 80 | 89 |
| 81 } // namespace extensions | 90 } // namespace extensions |
| 82 | 91 |
| 83 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 92 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
| OLD | NEW |