Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Unified Diff: chrome/browser/chromeos/file_system_provider/service.h

Issue 295413002: [fsp] Store mounted file systems in preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d98276792617c458e134684df3c85fbab91a5229..20cc91cf9cd1fc8806545b2d9a419243d569b25d 100644
--- a/chrome/browser/chromeos/file_system_provider/service.h
+++ b/chrome/browser/chromeos/file_system_provider/service.h
@@ -15,6 +15,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "base/threading/thread_checker.h"
#include "base/values.h"
#include "chrome/browser/chromeos/file_system_provider/observer.h"
#include "chrome/browser/profiles/profile.h"
@@ -29,14 +30,25 @@ class EventRouter;
class ExtensionRegistry;
} // namespace extensions
+namespace user_prefs {
+class PrefRegistrySyncable;
+} // namespace user_prefs
+
namespace chromeos {
namespace file_system_provider {
+// Key names for preferences.
+extern const char kPrefKeyFileSystemId[];
+extern const char kPrefKeyFileSystemName[];
+
class ProvidedFileSystemFactoryInterface;
class ProvidedFileSystemInfo;
class ProvidedFileSystemInterface;
class ServiceFactory;
+// Registers preferences to remember registered file systems between reboots.
+void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+
// Manages and registers the file system provider service. Maintains provided
// file systems.
class Service : public KeyedService,
@@ -99,6 +111,9 @@ class Service : public KeyedService,
content::BrowserContext* browser_context,
const extensions::Extension* extension,
extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE;
+ virtual void OnExtensionLoaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension) OVERRIDE;
private:
// Key is a pair of an extension id and file system id, which makes it
@@ -114,12 +129,25 @@ 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();
+
+ // 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);
+
+ // Restores from preferences file systems mounted previously by the
+ // |extension_id| providing extension.
+ void RestoreFileSystems(const std::string& extension_id);
+
Profile* profile_;
extensions::ExtensionRegistry* extension_registry_; // Not owned.
FileSystemFactoryCallback file_system_factory_;
ObserverList<Observer> observers_;
ProvidedFileSystemMap file_system_map_; // Owns pointers.
MountPointNameToKeyMap mount_point_name_to_key_map_;
+ base::ThreadChecker thread_checker_;
base::WeakPtrFactory<Service> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(Service);
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698