session_preferences.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 ATOM_BROWSER_SESSION_PREFERENCES_H_
  5. #define ATOM_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 base {
  11. class CommandLine;
  12. }
  13. namespace atom {
  14. class SessionPreferences : public base::SupportsUserData::Data {
  15. public:
  16. static SessionPreferences* FromBrowserContext(
  17. content::BrowserContext* context);
  18. static void AppendExtraCommandLineSwitches(content::BrowserContext* context,
  19. base::CommandLine* command_line);
  20. explicit SessionPreferences(content::BrowserContext* context);
  21. ~SessionPreferences() override;
  22. void set_preloads(const std::vector<base::FilePath::StringType>& preloads) {
  23. preloads_ = preloads;
  24. }
  25. const std::vector<base::FilePath::StringType>& preloads() const {
  26. return preloads_;
  27. }
  28. private:
  29. // The user data key.
  30. static int kLocatorKey;
  31. std::vector<base::FilePath::StringType> preloads_;
  32. };
  33. } // namespace atom
  34. #endif // ATOM_BROWSER_SESSION_PREFERENCES_H_