Index: chrome/browser/chromeos/file_system_provider/service.h |
diff --git a/chrome/browser/chromeos/file_system_provider/service.h b/chrome/browser/chromeos/file_system_provider/service.h |
index a48fd2d7a1c1d086e0a661a53ae596e499088592..58cbc26a44f1fd560ce7627fcc156b0c6e20f0c2 100644 |
--- a/chrome/browser/chromeos/file_system_provider/service.h |
+++ b/chrome/browser/chromeos/file_system_provider/service.h |
@@ -58,6 +58,11 @@ class Service : public KeyedService, |
const ProvidedFileSystemInfo& file_system_info)> |
FileSystemFactoryCallback; |
+ // Reason for unmounting. In case of UNMOUNT_REASON_SHUTDOWN, the file system |
+ // will be remounted automatically after a reboot. In case of |
+ // UNMOUNT_REASON_USER it will be permanently unmounted. |
+ enum UnmountReason { UNMOUNT_REASON_USER, UNMOUNT_REASON_SHUTDOWN }; |
+ |
Service(Profile* profile, extensions::ExtensionRegistry* extension_registry); |
virtual ~Service(); |
@@ -75,7 +80,8 @@ class Service : public KeyedService, |
// Unmounts a file system with the specified |file_system_id| for the |
// |extension_id|. For success returns true, otherwise false. |
bool UnmountFileSystem(const std::string& extension_id, |
- const std::string& file_system_id); |
+ const std::string& file_system_id, |
+ UnmountReason reason); |
// Requests unmounting of the file system. The callback is called when the |
// request is accepted or rejected, with an error code. Returns false if the |
@@ -128,13 +134,14 @@ class Service : public KeyedService, |
void OnRequestUnmountStatus(const ProvidedFileSystemInfo& file_system_info, |
base::File::Error error); |
- // Saves a list of currently mounted file systems to preferences. Called |
- // from a destructor (on shutdown). |
- void RememberFileSystems(); |
+ // Remembers the file system in preferences, in order to remount after a |
+ // reboot. |
+ void RememberFileSystem(const ProvidedFileSystemInfo& file_system_info); |
- // Removes all of the file systems mounted by the |extension_id| from |
- // preferences, so they are not loaded again after reboot. |
- void ForgetFileSystems(const std::string& extension_id); |
+ // Removes the file system from preferences, so it is not remounmted anymore |
+ // after a reboot. |
+ void ForgetFileSystem(const std::string& extension_id, |
+ const std::string& file_system_id); |
// Restores from preferences file systems mounted previously by the |
// |extension_id| providing extension. |
@@ -147,6 +154,7 @@ class Service : public KeyedService, |
ProvidedFileSystemMap file_system_map_; // Owns pointers. |
MountPointNameToKeyMap mount_point_name_to_key_map_; |
base::ThreadChecker thread_checker_; |
+ scoped_ptr<base::DictionaryValue> file_systems_to_restore_; |
base::WeakPtrFactory<Service> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(Service); |