| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 ui::SelectFileDialog::Type picker_type); | 152 ui::SelectFileDialog::Type picker_type); |
| 153 | 153 |
| 154 private: | 154 private: |
| 155 void SetInitialPathOnFileThread(const base::FilePath& suggested_name, | 155 void SetInitialPathOnFileThread(const base::FilePath& suggested_name, |
| 156 const base::FilePath& previous_path); | 156 const base::FilePath& previous_path); |
| 157 | 157 |
| 158 // FilesSelected and FileSelectionCanceled are called by the file picker. | 158 // FilesSelected and FileSelectionCanceled are called by the file picker. |
| 159 void FilesSelected(const std::vector<base::FilePath>& path); | 159 void FilesSelected(const std::vector<base::FilePath>& path); |
| 160 void FileSelectionCanceled(); | 160 void FileSelectionCanceled(); |
| 161 | 161 |
| 162 // Check if |check_path|, the canonicalized form of the chosen directory | 162 // Check if the chosen directory is or is an ancestor of a sensitive |
| 163 // |paths|, is or is an ancestor of a sensitive directory. If so, show a | 163 // directory. If so, show a dialog to confirm that the user wants to open the |
| 164 // dialog to confirm that the user wants to open the directory. | 164 // directory. Calls OnDirectoryAccessConfirmed if the directory isn't |
| 165 // Calls OnDirectoryAccessConfirmed if the directory isn't sensitive or the | 165 // sensitive or the user chooses to open it. Otherwise, calls |
| 166 // user chooses to open it. Otherwise, calls FileSelectionCanceled. | 166 // FileSelectionCanceled. |
| 167 void ConfirmDirectoryAccessOnFileThread( | 167 void ConfirmDirectoryAccessOnFileThread( |
| 168 const base::FilePath& check_path, | 168 bool non_native_path, |
| 169 const std::vector<base::FilePath>& paths, | 169 const std::vector<base::FilePath>& paths, |
| 170 content::WebContents* web_contents); | 170 content::WebContents* web_contents); |
| 171 void OnDirectoryAccessConfirmed(const std::vector<base::FilePath>& paths); | 171 void OnDirectoryAccessConfirmed(const std::vector<base::FilePath>& paths); |
| 172 | 172 |
| 173 base::FilePath initial_path_; | 173 base::FilePath initial_path_; |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 class FileSystemRetainEntryFunction : public ChromeAsyncExtensionFunction { | 176 class FileSystemRetainEntryFunction : public ChromeAsyncExtensionFunction { |
| 177 public: | 177 public: |
| 178 DECLARE_EXTENSION_FUNCTION("fileSystem.retainEntry", FILESYSTEM_RETAINENTRY) | 178 DECLARE_EXTENSION_FUNCTION("fileSystem.retainEntry", FILESYSTEM_RETAINENTRY) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 FILESYSTEM_GETOBSERVEDENTRIES); | 236 FILESYSTEM_GETOBSERVEDENTRIES); |
| 237 | 237 |
| 238 protected: | 238 protected: |
| 239 ~FileSystemGetObservedEntriesFunction() override {} | 239 ~FileSystemGetObservedEntriesFunction() override {} |
| 240 bool RunSync() override; | 240 bool RunSync() override; |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 } // namespace extensions | 243 } // namespace extensions |
| 244 | 244 |
| 245 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 245 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
| OLD | NEW |