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

Side by Side Diff: chrome/browser/devtools/devtools_file_system_helper.h

Issue 11570081: Support file system access in DevTools with isolated file system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_HELPER_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_HELPER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/memory/ref_counted.h"
13
14 class FilePath;
15 class Profile;
16
17 namespace content {
18 class WebContents;
19 }
20
21 class DevToolsFileSystemHelper
pfeldman 2012/12/24 19:01:03 I think devtools_file_helper is sufficient and you
22 : public base::RefCountedThreadSafe<DevToolsFileSystemHelper> {
23 public:
24 struct FileSystem {
25 FileSystem(const std::string& filesystem_id,
26 const std::string& registered_name,
27 const std::string& file_system_path);
28
29 std::string filesystem_id;
30 std::string registered_name;
31 std::string file_system_path;
32 };
33
34 class Delegate {
35 public:
36 virtual ~Delegate() {}
37 virtual void FileSystemPermissionsLoaded(
38 std::vector<DevToolsFileSystemHelper::FileSystem> file_systems) = 0;
39 virtual void FileSystemFolderSelected(FileSystem file_system) = 0;
40 virtual void FileSystemFolderSelectionCanceled() = 0;
41 virtual void FileSystemFolderSelectionError(std::string error_string) = 0;
42 };
43
44 DevToolsFileSystemHelper(
45 content::WebContents* web_contents,
46 Profile* profile,
47 Delegate* delegate);
48 ~DevToolsFileSystemHelper();
49
50 void SelectFolderAndGrantPermission();
pfeldman 2012/12/24 19:01:03 It seems like these will produce corresponding del
51 void RequestPermissions();
52 void RevokePermission(const std::string& file_system_path);
53
54 private:
55 void FolderSelected(const FilePath& path);
56 void FolderSelectionCanceled();
57 void CheckSelectedPath(const FilePath& path);
58 void SelectedFileSystemPermitted(const FilePath& path);
59 void SelectedFileSystemForbidden();
60 void CheckSavedPathes(const std::vector<FilePath>& file_pathes);
61 void RegisterSavedFileSystems(const std::vector<FilePath>& file_pathes);
62
63 class SelectFolderDialog;
64
65 content::WebContents* web_contents_;
66 Profile* profile_;
67 Delegate* delegate_;
68 scoped_refptr<SelectFolderDialog> select_folder_dialog_;
69 DISALLOW_COPY_AND_ASSIGN(DevToolsFileSystemHelper);
70 };
71
72 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698