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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/chromeos/file_system_provider/registry_interface.h"
12 #include "chrome/browser/chromeos/file_system_provider/watcher.h"
16 namespace user_prefs
{
17 class PrefRegistrySyncable
;
18 } // namespace user_prefs
21 namespace file_system_provider
{
23 // Key names for preferences.
24 extern const char kPrefKeyFileSystemId
[];
25 extern const char kPrefKeyDisplayName
[];
26 extern const char kPrefKeyWritable
[];
27 extern const char kPrefKeySupportsNotifyTag
[];
28 extern const char kPrefKeyWatchers
[];
29 extern const char kPrefKeyWatcherEntryPath
[];
30 extern const char kPrefKeyWatcherRecursive
[];
31 extern const char kPrefKeyWatcherPersistentOrigins
[];
32 extern const char kPrefKeyWatcherLastTag
[];
33 extern const char kPrefKeyOpenedFilesLimit
[];
35 class ProvidedFileSystemInfo
;
37 // Registers preferences to remember registered file systems between reboots.
38 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable
* registry
);
40 // Remembers and restores file systems in a persistent storage.
41 class Registry
: public RegistryInterface
{
43 explicit Registry(Profile
* profile
);
46 // RegistryInterface overrides.
47 void RememberFileSystem(const ProvidedFileSystemInfo
& file_system_info
,
48 const Watchers
& watchers
) override
;
49 void ForgetFileSystem(const std::string
& extension_id
,
50 const std::string
& file_system_id
) override
;
51 scoped_ptr
<RestoredFileSystems
> RestoreFileSystems(
52 const std::string
& extension_id
) override
;
53 void UpdateWatcherTag(const ProvidedFileSystemInfo
& file_system_info
,
54 const Watcher
& watcher
) override
;
57 Profile
* profile_
; // Not owned.
58 DISALLOW_COPY_AND_ASSIGN(Registry
);
61 } // namespace file_system_provider
62 } // namespace chromeos
64 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_H_