pref_store_delegate.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright (c) 2018 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ELECTRON_SHELL_BROWSER_PREF_STORE_DELEGATE_H_
  5. #define ELECTRON_SHELL_BROWSER_PREF_STORE_DELEGATE_H_
  6. #include <vector>
  7. #include "base/memory/weak_ptr.h"
  8. #include "components/prefs/pref_value_store.h"
  9. class PersistentPrefStore;
  10. class PrefNotifier;
  11. class PrefRegistry;
  12. class PrefStore;
  13. namespace electron {
  14. class ElectronBrowserContext;
  15. // Retrieves handle to the in memory pref store that gets
  16. // initialized with the pref service.
  17. class PrefStoreDelegate : public PrefValueStore::Delegate {
  18. public:
  19. explicit PrefStoreDelegate(
  20. base::WeakPtr<ElectronBrowserContext> browser_context);
  21. ~PrefStoreDelegate() override;
  22. // disable copy
  23. PrefStoreDelegate(const PrefStoreDelegate&) = delete;
  24. PrefStoreDelegate& operator=(const PrefStoreDelegate&) = delete;
  25. void Init(PrefStore* managed_prefs,
  26. PrefStore* supervised_user_prefs,
  27. PrefStore* extension_prefs,
  28. PrefStore* standalone_browser_prefs,
  29. PrefStore* command_line_prefs,
  30. PrefStore* user_prefs,
  31. PrefStore* recommended_prefs,
  32. PrefStore* default_prefs,
  33. PrefNotifier* pref_notifier) override {}
  34. void InitIncognitoUserPrefs(
  35. scoped_refptr<PersistentPrefStore> incognito_user_prefs_overlay,
  36. scoped_refptr<PersistentPrefStore> incognito_user_prefs_underlay,
  37. const std::vector<const char*>& overlay_pref_names) override {}
  38. void InitPrefRegistry(PrefRegistry* pref_registry) override {}
  39. void UpdateCommandLinePrefStore(PrefStore* command_line_prefs) override;
  40. private:
  41. base::WeakPtr<ElectronBrowserContext> browser_context_;
  42. };
  43. } // namespace electron
  44. #endif // ELECTRON_SHELL_BROWSER_PREF_STORE_DELEGATE_H_