pref_store_delegate.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 SHELL_BROWSER_PREF_STORE_DELEGATE_H_
  5. #define SHELL_BROWSER_PREF_STORE_DELEGATE_H_
  6. #include <vector>
  7. #include "base/macros.h"
  8. #include "base/memory/weak_ptr.h"
  9. #include "components/prefs/persistent_pref_store.h"
  10. #include "components/prefs/pref_value_store.h"
  11. namespace electron {
  12. class ElectronBrowserContext;
  13. // Retrieves handle to the in memory pref store that gets
  14. // initialized with the pref service.
  15. class PrefStoreDelegate : public PrefValueStore::Delegate {
  16. public:
  17. explicit PrefStoreDelegate(
  18. base::WeakPtr<ElectronBrowserContext> browser_context);
  19. ~PrefStoreDelegate() override;
  20. void Init(PrefStore* managed_prefs,
  21. PrefStore* supervised_user_prefs,
  22. PrefStore* extension_prefs,
  23. PrefStore* command_line_prefs,
  24. PrefStore* user_prefs,
  25. PrefStore* recommended_prefs,
  26. PrefStore* default_prefs,
  27. PrefNotifier* pref_notifier) override {}
  28. void InitIncognitoUserPrefs(
  29. scoped_refptr<PersistentPrefStore> incognito_user_prefs_overlay,
  30. scoped_refptr<PersistentPrefStore> incognito_user_prefs_underlay,
  31. const std::vector<const char*>& overlay_pref_names) override {}
  32. void InitPrefRegistry(PrefRegistry* pref_registry) override {}
  33. void UpdateCommandLinePrefStore(PrefStore* command_line_prefs) override;
  34. private:
  35. base::WeakPtr<ElectronBrowserContext> browser_context_;
  36. DISALLOW_COPY_AND_ASSIGN(PrefStoreDelegate);
  37. };
  38. } // namespace electron
  39. #endif // SHELL_BROWSER_PREF_STORE_DELEGATE_H_