2017-12-05 06:59:15 +00:00
|
|
|
// Copyright (c) 2017 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_SESSION_PREFERENCES_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_SESSION_PREFERENCES_H_
|
2017-12-05 06:59:15 +00:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "base/files/file_path.h"
|
|
|
|
#include "base/supports_user_data.h"
|
2021-07-02 00:51:37 +00:00
|
|
|
|
|
|
|
namespace content {
|
|
|
|
class BrowserContext;
|
|
|
|
}
|
2017-12-05 06:59:15 +00:00
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2017-12-05 06:59:15 +00:00
|
|
|
|
|
|
|
class SessionPreferences : public base::SupportsUserData::Data {
|
|
|
|
public:
|
|
|
|
static SessionPreferences* FromBrowserContext(
|
|
|
|
content::BrowserContext* context);
|
2020-11-10 17:06:03 +00:00
|
|
|
static std::vector<base::FilePath> GetValidPreloads(
|
2019-07-03 15:05:45 +00:00
|
|
|
content::BrowserContext* context);
|
2017-12-05 06:59:15 +00:00
|
|
|
|
2023-06-09 16:20:43 +00:00
|
|
|
static void CreateForBrowserContext(content::BrowserContext* context);
|
|
|
|
|
2017-12-05 06:59:15 +00:00
|
|
|
~SessionPreferences() override;
|
|
|
|
|
2020-11-10 17:06:03 +00:00
|
|
|
void set_preloads(const std::vector<base::FilePath>& preloads) {
|
2017-12-05 06:59:15 +00:00
|
|
|
preloads_ = preloads;
|
|
|
|
}
|
2020-11-10 17:06:03 +00:00
|
|
|
const std::vector<base::FilePath>& preloads() const { return preloads_; }
|
2017-12-05 06:59:15 +00:00
|
|
|
|
|
|
|
private:
|
2023-06-09 16:20:43 +00:00
|
|
|
SessionPreferences();
|
|
|
|
|
2017-12-05 06:59:15 +00:00
|
|
|
// The user data key.
|
|
|
|
static int kLocatorKey;
|
|
|
|
|
2020-11-10 17:06:03 +00:00
|
|
|
std::vector<base::FilePath> preloads_;
|
2017-12-05 06:59:15 +00:00
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2017-12-05 06:59:15 +00:00
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_SESSION_PREFERENCES_H_
|