| 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 <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 std::string file_system_name; | 40 std::string file_system_name; |
| 41 std::string root_url; | 41 std::string root_url; |
| 42 std::string file_system_path; | 42 std::string file_system_path; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 class Delegate { | 45 class Delegate { |
| 46 public: | 46 public: |
| 47 virtual ~Delegate() {} | 47 virtual ~Delegate() {} |
| 48 virtual void FileSystemAdded(const FileSystem& file_system) = 0; | 48 virtual void FileSystemAdded(const FileSystem& file_system) = 0; |
| 49 virtual void FileSystemRemoved(const std::string& file_system_path) = 0; | 49 virtual void FileSystemRemoved(const std::string& file_system_path) = 0; |
| 50 virtual void FilePathsChanged(const std::vector<std::string>& paths) = 0; | 50 virtual void FilePathsChanged( |
| 51 const std::vector<std::string>& changed_paths, |
| 52 const std::vector<std::string>& added_paths, |
| 53 const std::vector<std::string>& removed_paths) = 0; |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 DevToolsFileHelper(content::WebContents* web_contents, Profile* profile, | 56 DevToolsFileHelper(content::WebContents* web_contents, Profile* profile, |
| 54 Delegate* delegate); | 57 Delegate* delegate); |
| 55 ~DevToolsFileHelper(); | 58 ~DevToolsFileHelper(); |
| 56 | 59 |
| 57 typedef base::Callback<void(void)> SaveCallback; | 60 typedef base::Callback<void(void)> SaveCallback; |
| 58 typedef base::Callback<void(void)> AppendCallback; | 61 typedef base::Callback<void(void)> AppendCallback; |
| 59 typedef base::Callback<void(const base::string16&, | 62 typedef base::Callback<void(const base::string16&, |
| 60 const base::Callback<void(bool)>&)> | 63 const base::Callback<void(bool)>&)> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void InnerAddFileSystem( | 128 void InnerAddFileSystem( |
| 126 const ShowInfoBarCallback& show_info_bar_callback, | 129 const ShowInfoBarCallback& show_info_bar_callback, |
| 127 const base::FilePath& path); | 130 const base::FilePath& path); |
| 128 void CheckProjectFileExistsAndAddFileSystem( | 131 void CheckProjectFileExistsAndAddFileSystem( |
| 129 const ShowInfoBarCallback& show_info_bar_callback, | 132 const ShowInfoBarCallback& show_info_bar_callback, |
| 130 const base::FilePath& path); | 133 const base::FilePath& path); |
| 131 void AddUserConfirmedFileSystem( | 134 void AddUserConfirmedFileSystem( |
| 132 const base::FilePath& path, | 135 const base::FilePath& path, |
| 133 bool allowed); | 136 bool allowed); |
| 134 void FileSystemPathsSettingChanged(); | 137 void FileSystemPathsSettingChanged(); |
| 135 void FilePathsChanged(const std::vector<std::string>& paths); | 138 void FilePathsChanged(const std::vector<std::string>& changed_paths, |
| 139 const std::vector<std::string>& added_paths, |
| 140 const std::vector<std::string>& removed_paths); |
| 136 | 141 |
| 137 content::WebContents* web_contents_; | 142 content::WebContents* web_contents_; |
| 138 Profile* profile_; | 143 Profile* profile_; |
| 139 DevToolsFileHelper::Delegate* delegate_; | 144 DevToolsFileHelper::Delegate* delegate_; |
| 140 typedef std::map<std::string, base::FilePath> PathsMap; | 145 typedef std::map<std::string, base::FilePath> PathsMap; |
| 141 PathsMap saved_files_; | 146 PathsMap saved_files_; |
| 142 PrefChangeRegistrar pref_change_registrar_; | 147 PrefChangeRegistrar pref_change_registrar_; |
| 143 std::set<std::string> file_system_paths_; | 148 std::set<std::string> file_system_paths_; |
| 144 std::unique_ptr<DevToolsFileWatcher> file_watcher_; | 149 std::unique_ptr<DevToolsFileWatcher> file_watcher_; |
| 145 base::WeakPtrFactory<DevToolsFileHelper> weak_factory_; | 150 base::WeakPtrFactory<DevToolsFileHelper> weak_factory_; |
| 146 DISALLOW_COPY_AND_ASSIGN(DevToolsFileHelper); | 151 DISALLOW_COPY_AND_ASSIGN(DevToolsFileHelper); |
| 147 }; | 152 }; |
| 148 | 153 |
| 149 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_HELPER_H_ | 154 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_HELPER_H_ |
| OLD | NEW |