| 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_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 ui::SelectFileDialog::Type picker_type); | 150 ui::SelectFileDialog::Type picker_type); |
| 151 | 151 |
| 152 private: | 152 private: |
| 153 void SetInitialPathOnFileThread(const base::FilePath& suggested_name, | 153 void SetInitialPathOnFileThread(const base::FilePath& suggested_name, |
| 154 const base::FilePath& previous_path); | 154 const base::FilePath& previous_path); |
| 155 | 155 |
| 156 // FilesSelected and FileSelectionCanceled are called by the file picker. | 156 // FilesSelected and FileSelectionCanceled are called by the file picker. |
| 157 void FilesSelected(const std::vector<base::FilePath>& path); | 157 void FilesSelected(const std::vector<base::FilePath>& path); |
| 158 void FileSelectionCanceled(); | 158 void FileSelectionCanceled(); |
| 159 | 159 |
| 160 // Check if the chosen directory is or is an ancestor of a sensitive | 160 // Check if |check_path|, the canonicalized form of the chosen directory |
| 161 // directory. If so, show a dialog to confirm that the user wants to open the | 161 // |paths|, is or is an ancestor of a sensitive directory. If so, show a |
| 162 // directory. Calls OnDirectoryAccessConfirmed if the directory isn't | 162 // dialog to confirm that the user wants to open the directory. |
| 163 // sensitive or the user chooses to open it. Otherwise, calls | 163 // Calls OnDirectoryAccessConfirmed if the directory isn't sensitive or the |
| 164 // FileSelectionCanceled. | 164 // user chooses to open it. Otherwise, calls FileSelectionCanceled. |
| 165 void ConfirmDirectoryAccessOnFileThread( | 165 void ConfirmDirectoryAccessOnFileThread( |
| 166 const base::FilePath& check_path, |
| 166 const std::vector<base::FilePath>& paths, | 167 const std::vector<base::FilePath>& paths, |
| 167 content::WebContents* web_contents); | 168 content::WebContents* web_contents); |
| 168 void OnDirectoryAccessConfirmed(const std::vector<base::FilePath>& paths); | 169 void OnDirectoryAccessConfirmed(const std::vector<base::FilePath>& paths); |
| 169 | 170 |
| 170 base::FilePath initial_path_; | 171 base::FilePath initial_path_; |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 class FileSystemRetainEntryFunction : public ChromeAsyncExtensionFunction { | 174 class FileSystemRetainEntryFunction : public ChromeAsyncExtensionFunction { |
| 174 public: | 175 public: |
| 175 DECLARE_EXTENSION_FUNCTION("fileSystem.retainEntry", FILESYSTEM_RETAINENTRY) | 176 DECLARE_EXTENSION_FUNCTION("fileSystem.retainEntry", FILESYSTEM_RETAINENTRY) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 206 DECLARE_EXTENSION_FUNCTION("fileSystem.restoreEntry", FILESYSTEM_RESTOREENTRY) | 207 DECLARE_EXTENSION_FUNCTION("fileSystem.restoreEntry", FILESYSTEM_RESTOREENTRY) |
| 207 | 208 |
| 208 protected: | 209 protected: |
| 209 virtual ~FileSystemRestoreEntryFunction() {} | 210 virtual ~FileSystemRestoreEntryFunction() {} |
| 210 virtual bool RunAsync() OVERRIDE; | 211 virtual bool RunAsync() OVERRIDE; |
| 211 }; | 212 }; |
| 212 | 213 |
| 213 } // namespace extensions | 214 } // namespace extensions |
| 214 | 215 |
| 215 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 216 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
| OLD | NEW |