| 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_DEVTOOLS_DEVTOOLS_FILE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_HELPER_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_HELPER_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 | 16 |
| 17 class Profile; |
| 18 |
| 19 namespace base { |
| 17 class FilePath; | 20 class FilePath; |
| 18 class Profile; | 21 } |
| 19 | 22 |
| 20 namespace content { | 23 namespace content { |
| 21 class WebContents; | 24 class WebContents; |
| 22 } | 25 } |
| 23 | 26 |
| 24 class DevToolsFileHelper { | 27 class DevToolsFileHelper { |
| 25 public: | 28 public: |
| 26 struct FileSystem { | 29 struct FileSystem { |
| 27 FileSystem(); | 30 FileSystem(); |
| 28 FileSystem(const std::string& file_system_name, | 31 FileSystem(const std::string& file_system_name, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // FileSystem structs for registered file systems to |callback|. | 80 // FileSystem structs for registered file systems to |callback|. |
| 78 void RequestFileSystems(const RequestFileSystemsCallback& callback); | 81 void RequestFileSystems(const RequestFileSystemsCallback& callback); |
| 79 | 82 |
| 80 // Removes isolated file system for given |file_system_path|. | 83 // Removes isolated file system for given |file_system_path|. |
| 81 void RemoveFileSystem(const std::string& file_system_path); | 84 void RemoveFileSystem(const std::string& file_system_path); |
| 82 | 85 |
| 83 private: | 86 private: |
| 84 void SaveAsFileSelected(const std::string& url, | 87 void SaveAsFileSelected(const std::string& url, |
| 85 const std::string& content, | 88 const std::string& content, |
| 86 const SaveCallback& callback, | 89 const SaveCallback& callback, |
| 87 const FilePath& path); | 90 const base::FilePath& path); |
| 88 void SaveAsFileSelectionCanceled(); | 91 void SaveAsFileSelectionCanceled(); |
| 89 void InnerAddFileSystem(const AddFileSystemCallback& callback, | 92 void InnerAddFileSystem(const AddFileSystemCallback& callback, |
| 90 const FilePath& path); | 93 const base::FilePath& path); |
| 91 void AddValidatedFileSystem(const AddFileSystemCallback& callback, | 94 void AddValidatedFileSystem( |
| 92 const std::vector<FilePath>& permitted_paths); | 95 const AddFileSystemCallback& callback, |
| 93 void RestoreValidatedFileSystems(const RequestFileSystemsCallback& callback, | 96 const std::vector<base::FilePath>& permitted_paths); |
| 94 const std::vector<FilePath>& file_paths); | 97 void RestoreValidatedFileSystems( |
| 98 const RequestFileSystemsCallback& callback, |
| 99 const std::vector<base::FilePath>& file_paths); |
| 95 | 100 |
| 96 content::WebContents* web_contents_; | 101 content::WebContents* web_contents_; |
| 97 Profile* profile_; | 102 Profile* profile_; |
| 98 base::WeakPtrFactory<DevToolsFileHelper> weak_factory_; | 103 base::WeakPtrFactory<DevToolsFileHelper> weak_factory_; |
| 99 typedef std::map<std::string, FilePath> PathsMap; | 104 typedef std::map<std::string, base::FilePath> PathsMap; |
| 100 PathsMap saved_files_; | 105 PathsMap saved_files_; |
| 101 DISALLOW_COPY_AND_ASSIGN(DevToolsFileHelper); | 106 DISALLOW_COPY_AND_ASSIGN(DevToolsFileHelper); |
| 102 }; | 107 }; |
| 103 | 108 |
| 104 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_HELPER_H_ | 109 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_HELPER_H_ |
| OLD | NEW |