session_preferences.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (c) 2017 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_SESSION_PREFERENCES_H_
  5. #define SHELL_BROWSER_SESSION_PREFERENCES_H_
  6. #include <vector>
  7. #include "base/files/file_path.h"
  8. #include "base/supports_user_data.h"
  9. #include "content/public/browser/browser_context.h"
  10. namespace electron {
  11. class SessionPreferences : public base::SupportsUserData::Data {
  12. public:
  13. static SessionPreferences* FromBrowserContext(
  14. content::BrowserContext* context);
  15. static std::vector<base::FilePath::StringType> GetValidPreloads(
  16. content::BrowserContext* context);
  17. explicit SessionPreferences(content::BrowserContext* context);
  18. ~SessionPreferences() override;
  19. void set_preloads(const std::vector<base::FilePath::StringType>& preloads) {
  20. preloads_ = preloads;
  21. }
  22. const std::vector<base::FilePath::StringType>& preloads() const {
  23. return preloads_;
  24. }
  25. private:
  26. // The user data key.
  27. static int kLocatorKey;
  28. std::vector<base::FilePath::StringType> preloads_;
  29. };
  30. } // namespace electron
  31. #endif // SHELL_BROWSER_SESSION_PREFERENCES_H_