| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 class ProvidedFileSystemFactoryInterface; | 43 class ProvidedFileSystemFactoryInterface; |
| 44 class ProvidedFileSystemInfo; | 44 class ProvidedFileSystemInfo; |
| 45 class ProvidedFileSystemInterface; | 45 class ProvidedFileSystemInterface; |
| 46 class RegistryInterface; | 46 class RegistryInterface; |
| 47 class ServiceFactory; | 47 class ServiceFactory; |
| 48 struct MountOptions; | 48 struct MountOptions; |
| 49 | 49 |
| 50 // Registers preferences to remember registered file systems between reboots. | 50 // Registers preferences to remember registered file systems between reboots. |
| 51 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 51 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 52 | 52 |
| 53 // Holds information for a providing extension. |
| 54 struct ProvidingExtensionInfo { |
| 55 ProvidingExtensionInfo(); |
| 56 ~ProvidingExtensionInfo(); |
| 57 |
| 58 std::string extension_id; |
| 59 std::string name; |
| 60 bool can_configure; |
| 61 bool can_add; |
| 62 }; |
| 63 |
| 53 // Manages and registers the file system provider service. Maintains provided | 64 // Manages and registers the file system provider service. Maintains provided |
| 54 // file systems. | 65 // file systems. |
| 55 class Service : public KeyedService, | 66 class Service : public KeyedService, |
| 56 public extensions::ExtensionRegistryObserver, | 67 public extensions::ExtensionRegistryObserver, |
| 57 public ProvidedFileSystemObserver { | 68 public ProvidedFileSystemObserver { |
| 58 public: | 69 public: |
| 59 typedef base::Callback<ProvidedFileSystemInterface*( | 70 typedef base::Callback<ProvidedFileSystemInterface*( |
| 60 Profile* profile, | 71 Profile* profile, |
| 61 const ProvidedFileSystemInfo& file_system_info)> | 72 const ProvidedFileSystemInfo& file_system_info)> |
| 62 FileSystemFactoryCallback; | 73 FileSystemFactoryCallback; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // the extension with |extension_id|. If not found, then returns NULL. | 122 // the extension with |extension_id|. If not found, then returns NULL. |
| 112 ProvidedFileSystemInterface* GetProvidedFileSystem( | 123 ProvidedFileSystemInterface* GetProvidedFileSystem( |
| 113 const std::string& extension_id, | 124 const std::string& extension_id, |
| 114 const std::string& file_system_id); | 125 const std::string& file_system_id); |
| 115 | 126 |
| 116 // Returns a provided file system attached to the the passed | 127 // Returns a provided file system attached to the the passed |
| 117 // |mount_point_name|. If not found, then returns NULL. | 128 // |mount_point_name|. If not found, then returns NULL. |
| 118 ProvidedFileSystemInterface* GetProvidedFileSystem( | 129 ProvidedFileSystemInterface* GetProvidedFileSystem( |
| 119 const std::string& mount_point_name); | 130 const std::string& mount_point_name); |
| 120 | 131 |
| 132 // Returns a list of information of all currently installed providing |
| 133 // extensions. |
| 134 std::vector<ProvidingExtensionInfo> GetProvidingExtensionInfoList() const; |
| 135 |
| 121 // Adds and removes observers. | 136 // Adds and removes observers. |
| 122 void AddObserver(Observer* observer); | 137 void AddObserver(Observer* observer); |
| 123 void RemoveObserver(Observer* observer); | 138 void RemoveObserver(Observer* observer); |
| 124 | 139 |
| 125 // Gets the singleton instance for the |context|. | 140 // Gets the singleton instance for the |context|. |
| 126 static Service* Get(content::BrowserContext* context); | 141 static Service* Get(content::BrowserContext* context); |
| 127 | 142 |
| 128 // extensions::ExtensionRegistryObserver overrides. | 143 // extensions::ExtensionRegistryObserver overrides. |
| 129 void OnExtensionUnloaded( | 144 void OnExtensionUnloaded( |
| 130 content::BrowserContext* browser_context, | 145 content::BrowserContext* browser_context, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 base::ThreadChecker thread_checker_; | 205 base::ThreadChecker thread_checker_; |
| 191 | 206 |
| 192 base::WeakPtrFactory<Service> weak_ptr_factory_; | 207 base::WeakPtrFactory<Service> weak_ptr_factory_; |
| 193 DISALLOW_COPY_AND_ASSIGN(Service); | 208 DISALLOW_COPY_AND_ASSIGN(Service); |
| 194 }; | 209 }; |
| 195 | 210 |
| 196 } // namespace file_system_provider | 211 } // namespace file_system_provider |
| 197 } // namespace chromeos | 212 } // namespace chromeos |
| 198 | 213 |
| 199 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 214 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
| OLD | NEW |