Chromium Code Reviews| Index: chrome/browser/devtools/devtools_file_system_helper.h |
| diff --git a/chrome/browser/devtools/devtools_file_system_helper.h b/chrome/browser/devtools/devtools_file_system_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fda53435824c5da64482bc04697823b6cd42a811 |
| --- /dev/null |
| +++ b/chrome/browser/devtools/devtools_file_system_helper.h |
| @@ -0,0 +1,72 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_HELPER_H_ |
| +#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_HELPER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/ref_counted.h" |
| + |
| +class FilePath; |
| +class Profile; |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +class DevToolsFileSystemHelper |
|
pfeldman
2012/12/24 19:01:03
I think devtools_file_helper is sufficient and you
|
| + : public base::RefCountedThreadSafe<DevToolsFileSystemHelper> { |
| + public: |
| + struct FileSystem { |
| + FileSystem(const std::string& filesystem_id, |
| + const std::string& registered_name, |
| + const std::string& file_system_path); |
| + |
| + std::string filesystem_id; |
| + std::string registered_name; |
| + std::string file_system_path; |
| + }; |
| + |
| + class Delegate { |
| + public: |
| + virtual ~Delegate() {} |
| + virtual void FileSystemPermissionsLoaded( |
| + std::vector<DevToolsFileSystemHelper::FileSystem> file_systems) = 0; |
| + virtual void FileSystemFolderSelected(FileSystem file_system) = 0; |
| + virtual void FileSystemFolderSelectionCanceled() = 0; |
| + virtual void FileSystemFolderSelectionError(std::string error_string) = 0; |
| + }; |
| + |
| + DevToolsFileSystemHelper( |
| + content::WebContents* web_contents, |
| + Profile* profile, |
| + Delegate* delegate); |
| + ~DevToolsFileSystemHelper(); |
| + |
| + void SelectFolderAndGrantPermission(); |
|
pfeldman
2012/12/24 19:01:03
It seems like these will produce corresponding del
|
| + void RequestPermissions(); |
| + void RevokePermission(const std::string& file_system_path); |
| + |
| + private: |
| + void FolderSelected(const FilePath& path); |
| + void FolderSelectionCanceled(); |
| + void CheckSelectedPath(const FilePath& path); |
| + void SelectedFileSystemPermitted(const FilePath& path); |
| + void SelectedFileSystemForbidden(); |
| + void CheckSavedPathes(const std::vector<FilePath>& file_pathes); |
| + void RegisterSavedFileSystems(const std::vector<FilePath>& file_pathes); |
| + |
| + class SelectFolderDialog; |
| + |
| + content::WebContents* web_contents_; |
| + Profile* profile_; |
| + Delegate* delegate_; |
| + scoped_refptr<SelectFolderDialog> select_folder_dialog_; |
| + DISALLOW_COPY_AND_ASSIGN(DevToolsFileSystemHelper); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_HELPER_H_ |