| 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_REGISTRY_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_INTERFACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/chromeos/file_system_provider/observed_entry.h" | |
| 14 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" | 13 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" |
| 14 #include "chrome/browser/chromeos/file_system_provider/watcher.h" |
| 15 | 15 |
| 16 namespace chromeos { | 16 namespace chromeos { |
| 17 namespace file_system_provider { | 17 namespace file_system_provider { |
| 18 | 18 |
| 19 // Remembers and restores file systems in a persistent storage. | 19 // Remembers and restores file systems in a persistent storage. |
| 20 class RegistryInterface { | 20 class RegistryInterface { |
| 21 public: | 21 public: |
| 22 struct RestoredFileSystem; | 22 struct RestoredFileSystem; |
| 23 | 23 |
| 24 // List of file systems together with their observed entries to be remounted. | 24 // List of file systems together with their watchers to be remounted. |
| 25 typedef std::vector<RestoredFileSystem> RestoredFileSystems; | 25 typedef std::vector<RestoredFileSystem> RestoredFileSystems; |
| 26 | 26 |
| 27 // Information about a file system to be restored. | 27 // Information about a file system to be restored. |
| 28 struct RestoredFileSystem { | 28 struct RestoredFileSystem { |
| 29 RestoredFileSystem(); | 29 RestoredFileSystem(); |
| 30 ~RestoredFileSystem(); | 30 ~RestoredFileSystem(); |
| 31 | 31 |
| 32 std::string extension_id; | 32 std::string extension_id; |
| 33 MountOptions options; | 33 MountOptions options; |
| 34 ObservedEntries observed_entries; | 34 Watchers watchers; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 virtual ~RegistryInterface(); | 37 virtual ~RegistryInterface(); |
| 38 | 38 |
| 39 // Remembers the file system in preferences, in order to remount after a | 39 // Remembers the file system in preferences, in order to remount after a |
| 40 // reboot. | 40 // reboot. |
| 41 virtual void RememberFileSystem( | 41 virtual void RememberFileSystem( |
| 42 const ProvidedFileSystemInfo& file_system_info, | 42 const ProvidedFileSystemInfo& file_system_info, |
| 43 const ObservedEntries& observed_entries) = 0; | 43 const Watchers& watchers) = 0; |
| 44 | 44 |
| 45 // Removes the file system from preferences, so it is not remounmted anymore | 45 // Removes the file system from preferences, so it is not remounmted anymore |
| 46 // after a reboot. | 46 // after a reboot. |
| 47 virtual void ForgetFileSystem(const std::string& extension_id, | 47 virtual void ForgetFileSystem(const std::string& extension_id, |
| 48 const std::string& file_system_id) = 0; | 48 const std::string& file_system_id) = 0; |
| 49 | 49 |
| 50 // Restores from preferences file systems mounted previously by the | 50 // Restores from preferences file systems mounted previously by the |
| 51 // |extension_id| providing extension. The returned list should be used to | 51 // |extension_id| providing extension. The returned list should be used to |
| 52 // remount them. | 52 // remount them. |
| 53 virtual scoped_ptr<RestoredFileSystems> RestoreFileSystems( | 53 virtual scoped_ptr<RestoredFileSystems> RestoreFileSystems( |
| 54 const std::string& extension_id) = 0; | 54 const std::string& extension_id) = 0; |
| 55 | 55 |
| 56 // Updates a tag for the specified observed entry. | 56 // Updates a tag for the specified watcher. |
| 57 virtual void UpdateObservedEntryTag( | 57 virtual void UpdateWatcherTag(const ProvidedFileSystemInfo& file_system_info, |
| 58 const ProvidedFileSystemInfo& file_system_info, | 58 const Watcher& watcher) = 0; |
| 59 const ObservedEntry& observed_entry) = 0; | |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 } // namespace file_system_provider | 61 } // namespace file_system_provider |
| 63 } // namespace chromeos | 62 } // namespace chromeos |
| 64 | 63 |
| 65 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_INTERFACE_H_ | 64 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_INTERFACE_H_ |
| OLD | NEW |