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..90266a1a26e447894e54a57a9ae4a6f8e0ddd17c 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; |
+ // Mode of unmounting. In case of UNMOUNT_MODE_SHUTDOWN, the file system will |
hashimoto
2014/07/02 08:59:37
nit: How about using the term "reason" instead of
mtomasz
2014/07/03 05:24:07
Good idea. Done.
|
+ // be remounted automatically after a reboot. In case of UNMOUNT_MODE_USER it |
+ // will be permanently unmounted. |
+ enum UnmountMode { UNMOUNT_MODE_USER, UNMOUNT_MODE_SHUTDOWN }; |
hashimoto
2014/07/02 08:59:37
Is there any reason to make this enum public?
Seem
mtomasz
2014/07/03 05:24:07
This enum is used from file_system_provider_api.cc
hashimoto
2014/07/04 06:38:41
Public interface should be minimal to encapsulte t
mtomasz
2014/07/04 07:50:42
We don't want to forget on SHUTDOWN. We need to fo
hashimoto
2014/07/07 11:07:46
Ah, I see.
Then exposing this enum may be acceptab
|
+ |
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, |
+ UnmountMode mode); |
// 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,13 @@ 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 ProvidedFileSystemInfo& file_system_info); |
// Restores from preferences file systems mounted previously by the |
// |extension_id| providing extension. |
@@ -147,6 +153,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); |