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.
|
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#ifndef SHELL_BROWSER_SESSION_PREFERENCES_H_
|
|
|
|
#define 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
|
|
|
|
|
|
|
explicit SessionPreferences(content::BrowserContext* context);
|
|
|
|
~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:
|
|
|
|
// 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
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#endif // SHELL_BROWSER_SESSION_PREFERENCES_H_
|