| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 namespace user_prefs { | 32 namespace user_prefs { |
| 33 class PrefRegistrySyncable; | 33 class PrefRegistrySyncable; |
| 34 } // namespace user_prefs | 34 } // namespace user_prefs |
| 35 | 35 |
| 36 namespace chromeos { | 36 namespace chromeos { |
| 37 namespace file_system_provider { | 37 namespace file_system_provider { |
| 38 | 38 |
| 39 // Key names for preferences. | 39 // Key names for preferences. |
| 40 extern const char kPrefKeyFileSystemId[]; | 40 extern const char kPrefKeyFileSystemId[]; |
| 41 extern const char kPrefKeyFileSystemName[]; | 41 extern const char kPrefKeyDisplayName[]; |
| 42 | 42 |
| 43 class ProvidedFileSystemFactoryInterface; | 43 class ProvidedFileSystemFactoryInterface; |
| 44 class ProvidedFileSystemInfo; | 44 class ProvidedFileSystemInfo; |
| 45 class ProvidedFileSystemInterface; | 45 class ProvidedFileSystemInterface; |
| 46 class ServiceFactory; | 46 class ServiceFactory; |
| 47 | 47 |
| 48 // Registers preferences to remember registered file systems between reboots. | 48 // Registers preferences to remember registered file systems between reboots. |
| 49 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 49 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 50 | 50 |
| 51 // Manages and registers the file system provider service. Maintains provided | 51 // Manages and registers the file system provider service. Maintains provided |
| (...skipping 11 matching lines...) Expand all Loading... |
| 63 | 63 |
| 64 // Sets a custom ProvidedFileSystemInterface factory. Used by unit tests, | 64 // Sets a custom ProvidedFileSystemInterface factory. Used by unit tests, |
| 65 // where an event router is not available. | 65 // where an event router is not available. |
| 66 void SetFileSystemFactoryForTesting( | 66 void SetFileSystemFactoryForTesting( |
| 67 const FileSystemFactoryCallback& factory_callback); | 67 const FileSystemFactoryCallback& factory_callback); |
| 68 | 68 |
| 69 // Mounts a file system provided by an extension with the |extension_id|. | 69 // Mounts a file system provided by an extension with the |extension_id|. |
| 70 // For success, returns true, otherwise false. | 70 // For success, returns true, otherwise false. |
| 71 bool MountFileSystem(const std::string& extension_id, | 71 bool MountFileSystem(const std::string& extension_id, |
| 72 const std::string& file_system_id, | 72 const std::string& file_system_id, |
| 73 const std::string& file_system_name); | 73 const std::string& display_name); |
| 74 | 74 |
| 75 // Unmounts a file system with the specified |file_system_id| for the | 75 // Unmounts a file system with the specified |file_system_id| for the |
| 76 // |extension_id|. For success returns true, otherwise false. | 76 // |extension_id|. For success returns true, otherwise false. |
| 77 bool UnmountFileSystem(const std::string& extension_id, | 77 bool UnmountFileSystem(const std::string& extension_id, |
| 78 const std::string& file_system_id); | 78 const std::string& file_system_id); |
| 79 | 79 |
| 80 // Requests unmounting of the file system. The callback is called when the | 80 // Requests unmounting of the file system. The callback is called when the |
| 81 // request is accepted or rejected, with an error code. Returns false if the | 81 // request is accepted or rejected, with an error code. Returns false if the |
| 82 // request could not been created, true otherwise. | 82 // request could not been created, true otherwise. |
| 83 bool RequestUnmount(const std::string& extension_id, | 83 bool RequestUnmount(const std::string& extension_id, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 base::ThreadChecker thread_checker_; | 149 base::ThreadChecker thread_checker_; |
| 150 base::WeakPtrFactory<Service> weak_ptr_factory_; | 150 base::WeakPtrFactory<Service> weak_ptr_factory_; |
| 151 | 151 |
| 152 DISALLOW_COPY_AND_ASSIGN(Service); | 152 DISALLOW_COPY_AND_ASSIGN(Service); |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace file_system_provider | 155 } // namespace file_system_provider |
| 156 } // namespace chromeos | 156 } // namespace chromeos |
| 157 | 157 |
| 158 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 158 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
| OLD | NEW |