OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_CHROME_FILE_SYSTEM_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_CHROME_FILE_SYSTEM_DELEGATE_H_ |
| 7 |
| 8 #include "extensions/browser/api/file_system/file_system_delegate.h" |
| 9 |
| 10 #include <memory> |
| 11 |
| 12 #include "base/macros.h" |
| 13 #include "build/build_config.h" |
| 14 |
| 15 namespace extensions { |
| 16 |
| 17 #if defined(OS_CHROMEOS) |
| 18 namespace file_system_api { |
| 19 |
| 20 // Dispatches an event about a mounted or unmounted volume in the system to |
| 21 // each extension which can request it. |
| 22 void DispatchVolumeListChangeEvent(content::BrowserContext* browser_context); |
| 23 |
| 24 } // namespace file_system_api |
| 25 #endif // defined(OS_CHROMEOS) |
| 26 |
| 27 class ChromeFileSystemDelegate : public FileSystemDelegate { |
| 28 public: |
| 29 ChromeFileSystemDelegate(); |
| 30 ~ChromeFileSystemDelegate() override; |
| 31 |
| 32 // FileSystemDelegate: |
| 33 base::FilePath GetDefaultDirectory() override; |
| 34 bool ShowSelectFileDialog( |
| 35 scoped_refptr<UIThreadExtensionFunction> extension_function, |
| 36 ui::SelectFileDialog::Type type, |
| 37 const base::FilePath& default_path, |
| 38 const ui::SelectFileDialog::FileTypeInfo* file_types, |
| 39 FileSystemDelegate::FilesSelectedCallback files_selected_callback, |
| 40 base::OnceClosure file_selection_canceled_callback) override; |
| 41 void ConfirmSensitiveDirectoryAccess(bool has_write_permission, |
| 42 const base::string16& app_name, |
| 43 content::WebContents* web_contents, |
| 44 const base::Closure& on_accept, |
| 45 const base::Closure& on_cancel) override; |
| 46 int GetDescriptionIdForAcceptType(const std::string& accept_type) override; |
| 47 #if defined(OS_CHROMEOS) |
| 48 bool IsGrantable(content::BrowserContext* browser_context, |
| 49 content::RenderFrameHost* render_frame_host, |
| 50 const Extension& extension) override; |
| 51 void RequestFileSystem(content::BrowserContext* browser_context, |
| 52 scoped_refptr<UIThreadExtensionFunction> requester, |
| 53 const Extension& extension, |
| 54 std::string volume_id, |
| 55 bool writable, |
| 56 const FileSystemCallback& success_callback, |
| 57 const ErrorCallback& error_callback) override; |
| 58 void GetVolumeList(content::BrowserContext* browser_context, |
| 59 const VolumeListCallback& success_callback, |
| 60 const ErrorCallback& error_callback) override; |
| 61 #endif // defined(OS_CHROMEOS) |
| 62 SavedFilesServiceInterface* GetSavedFilesService( |
| 63 content::BrowserContext* browser_context) override; |
| 64 |
| 65 private: |
| 66 DISALLOW_COPY_AND_ASSIGN(ChromeFileSystemDelegate); |
| 67 }; |
| 68 |
| 69 } // namespace extensions |
| 70 |
| 71 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_CHROME_FILE_SYSTEM_DELEGATE
_H_ |
OLD | NEW |