| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This file provides file system related API functions. | 5 // This file provides file system related API functions. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYSTEM_
H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYSTEM_
H_ |
| 8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYSTEM_
H_ | 8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYSTEM_
H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 namespace drive { | 37 namespace drive { |
| 38 namespace util { | 38 namespace util { |
| 39 class FileStreamMd5Digester; | 39 class FileStreamMd5Digester; |
| 40 } // namespace util | 40 } // namespace util |
| 41 struct HashAndFilePath; | 41 struct HashAndFilePath; |
| 42 } // namespace drive | 42 } // namespace drive |
| 43 | 43 |
| 44 namespace extensions { | 44 namespace extensions { |
| 45 | 45 |
| 46 // Implements the chrome.fileManagerPrivate.requestFileSystem method. | |
| 47 class FileManagerPrivateRequestFileSystemFunction | |
| 48 : public LoggedAsyncExtensionFunction { | |
| 49 public: | |
| 50 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestFileSystem", | |
| 51 FILEMANAGERPRIVATE_REQUESTFILESYSTEM) | |
| 52 | |
| 53 protected: | |
| 54 ~FileManagerPrivateRequestFileSystemFunction() override {} | |
| 55 | |
| 56 // AsyncExtensionFunction overrides. | |
| 57 bool RunAsync() override; | |
| 58 | |
| 59 private: | |
| 60 void RespondSuccessOnUIThread(const std::string& name, | |
| 61 const GURL& root_url); | |
| 62 void RespondFailedOnUIThread(base::File::Error error_code); | |
| 63 | |
| 64 // Called when something goes wrong. Records the error to |error_| per the | |
| 65 // error code and reports that the private API function failed. | |
| 66 void DidFail(base::File::Error error_code); | |
| 67 | |
| 68 // Sets up file system access permissions to the extension identified by | |
| 69 // |child_id|. | |
| 70 bool SetupFileSystemAccessPermissions( | |
| 71 scoped_refptr<storage::FileSystemContext> file_system_context, | |
| 72 int child_id, | |
| 73 Profile* profile, | |
| 74 scoped_refptr<const extensions::Extension> extension, | |
| 75 const base::FilePath& mount_path, | |
| 76 const base::FilePath& virtual_path); | |
| 77 | |
| 78 // Called when the entry definition is computed. | |
| 79 void OnEntryDefinition( | |
| 80 const file_manager::util::EntryDefinition& entry_definition); | |
| 81 }; | |
| 82 | |
| 83 // Grant permission to request externalfile scheme. The permission is needed to | 46 // Grant permission to request externalfile scheme. The permission is needed to |
| 84 // start drag for external file URL. | 47 // start drag for external file URL. |
| 85 class FileManagerPrivateEnableExternalFileSchemeFunction | 48 class FileManagerPrivateEnableExternalFileSchemeFunction |
| 86 : public UIThreadExtensionFunction { | 49 : public UIThreadExtensionFunction { |
| 87 public: | 50 public: |
| 88 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.enableExternalFileScheme", | 51 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.enableExternalFileScheme", |
| 89 FILEMANAGERPRIVATE_ENABLEEXTERNALFILESCHEME); | 52 FILEMANAGERPRIVATE_ENABLEEXTERNALFILESCHEME); |
| 90 | 53 |
| 91 protected: | 54 protected: |
| 92 ~FileManagerPrivateEnableExternalFileSchemeFunction() override {} | 55 ~FileManagerPrivateEnableExternalFileSchemeFunction() override {} |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // Called when setting a tag is completed with either a success or an error. | 318 // Called when setting a tag is completed with either a success or an error. |
| 356 void OnSetEntryPropertyCompleted(drive::FileError result); | 319 void OnSetEntryPropertyCompleted(drive::FileError result); |
| 357 | 320 |
| 358 ExtensionFunction::ResponseAction Run() override; | 321 ExtensionFunction::ResponseAction Run() override; |
| 359 DISALLOW_COPY_AND_ASSIGN(FileManagerPrivateSetEntryTagFunction); | 322 DISALLOW_COPY_AND_ASSIGN(FileManagerPrivateSetEntryTagFunction); |
| 360 }; | 323 }; |
| 361 | 324 |
| 362 } // namespace extensions | 325 } // namespace extensions |
| 363 | 326 |
| 364 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYST
EM_H_ | 327 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYST
EM_H_ |
| OLD | NEW |