OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/chromeos/file_system_provider/observed_entry.h" |
| 12 #include "chrome/browser/chromeos/file_system_provider/registry_interface.h" |
| 13 |
| 14 class Profile; |
| 15 |
| 16 namespace user_prefs { |
| 17 class PrefRegistrySyncable; |
| 18 } // namespace user_prefs |
| 19 |
| 20 namespace chromeos { |
| 21 namespace file_system_provider { |
| 22 |
| 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 kPrefKeyObservedEntries[]; |
| 29 extern const char kPrefKeyObservedEntryEntryPath[]; |
| 30 extern const char kPrefKeyObservedEntryRecursive[]; |
| 31 extern const char kPrefKeyObservedEntryLastTag[]; |
| 32 |
| 33 class ProvidedFileSystemInfo; |
| 34 |
| 35 // Registers preferences to remember registered file systems between reboots. |
| 36 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 37 |
| 38 // Remembers and restores file systems in a persistent storage. |
| 39 class Registry : public RegistryInterface { |
| 40 public: |
| 41 explicit Registry(Profile* profile); |
| 42 virtual ~Registry(); |
| 43 |
| 44 // RegistryInterface overrides. |
| 45 virtual void RememberFileSystem( |
| 46 const ProvidedFileSystemInfo& file_system_info, |
| 47 const ObservedEntries& observed_entries) override; |
| 48 virtual void ForgetFileSystem(const std::string& extension_id, |
| 49 const std::string& file_system_id) override; |
| 50 virtual scoped_ptr<RestoredFileSystems> RestoreFileSystems( |
| 51 const std::string& extension_id) override; |
| 52 virtual void UpdateObservedEntryTag( |
| 53 const ProvidedFileSystemInfo& file_system_info, |
| 54 const ObservedEntry& observed_entry) override; |
| 55 |
| 56 private: |
| 57 Profile* profile_; // Not owned. |
| 58 DISALLOW_COPY_AND_ASSIGN(Registry); |
| 59 }; |
| 60 |
| 61 } // namespace file_system_provider |
| 62 } // namespace chromeos |
| 63 |
| 64 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REGISTRY_H_ |
OLD | NEW |