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

Side by Side Diff: chrome/browser/extensions/api/file_system/chrome_file_system_delegate.h

Issue 2934143002: Move chrome.fileSystem implementation to //extensions (Closed)
Patch Set: tentative workaround for file_manager tests Created 3 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 unified diff | Download patch
OLDNEW
(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 "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "build/build_config.h"
13
14 #if defined(OS_CHROMEOS)
15 #include "chrome/browser/extensions/api/file_system/consent_provider.h"
16 #endif
17
18 namespace extensions {
19
20 #if defined(OS_CHROMEOS)
21 namespace file_system_api {
22
23 // Dispatches an event about a mounted or unmounted volume in the system to
24 // each extension which can request it.
25 void DispatchVolumeListChangeEvent(content::BrowserContext* browser_context);
26
27 } // namespace file_system_api
28 #endif // defined(OS_CHROMEOS)
29
30 class ChromeFileSystemDelegate : public FileSystemDelegate {
31 public:
32 ChromeFileSystemDelegate();
33 ~ChromeFileSystemDelegate() override;
34
35 // FileSystemDelegate:
36 base::FilePath GetDefaultDirectory() override;
37 std::unique_ptr<ui::SelectFilePolicy> CreateSelectFilePolicy(
38 content::WebContents* web_contents) override;
39 scoped_refptr<ui::SelectFileDialog> CreateSelectFileDialog(
40 ui::SelectFileDialog::Listener* listener,
41 std::unique_ptr<ui::SelectFilePolicy> policy) override;
42 void ShowSelectFileDialogForWebContents(
43 scoped_refptr<ui::SelectFileDialog> dialog,
44 content::WebContents* web_contents,
45 ui::SelectFileDialog::Type type,
46 const base::FilePath& default_path,
47 const ui::SelectFileDialog::FileTypeInfo* file_types) override;
48 void ConfirmSensitiveDirectoryAccess(bool has_write_permission,
49 const base::string16& app_name,
50 content::WebContents* web_contents,
51 const base::Closure& on_accept,
52 const base::Closure& on_cancel) override;
53 int GetDescriptionIdForAcceptType(const std::string& accept_type) override;
54 #if defined(OS_CHROMEOS)
55 bool IsGrantable(content::BrowserContext* browser_context,
56 content::RenderFrameHost* render_frame_host,
57 const Extension& extension) override;
58 void RequestFileSystem(content::BrowserContext* browser_context,
59 scoped_refptr<UIThreadExtensionFunction> requester,
60 const Extension& extension,
61 std::string volume_id,
62 bool writable,
63 const FileSystemCallback& success_callback,
64 const ErrorCallback& error_callback) override;
65 void GetVolumeList(content::BrowserContext* browser_context,
66 const VolumeListCallback& success_callback,
67 const ErrorCallback& error_callback) override;
68 #endif // defined(OS_CHROMEOS)
69 SavedFilesServiceInterface* GetSavedFilesService(
70 content::BrowserContext* browser_context) override;
71
72 private:
73 DISALLOW_COPY_AND_ASSIGN(ChromeFileSystemDelegate);
74 };
75
76 } // namespace extensions
77
78 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_CHROME_FILE_SYSTEM_DELEGATE _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698