2017-12-05 15:59:15 +09: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 08:34:31 +01:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_SESSION_PREFERENCES_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_SESSION_PREFERENCES_H_
|
2017-12-05 15:59:15 +09:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "base/files/file_path.h"
|
|
|
|
#include "base/supports_user_data.h"
|
2025-01-31 09:46:17 -05:00
|
|
|
#include "shell/browser/preload_script.h"
|
2021-07-01 17:51:37 -07:00
|
|
|
|
|
|
|
namespace content {
|
|
|
|
class BrowserContext;
|
|
|
|
}
|
2017-12-05 15:59:15 +09:00
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
namespace electron {
|
2017-12-05 15:59:15 +09:00
|
|
|
|
|
|
|
class SessionPreferences : public base::SupportsUserData::Data {
|
|
|
|
public:
|
|
|
|
static SessionPreferences* FromBrowserContext(
|
|
|
|
content::BrowserContext* context);
|
|
|
|
|
2023-06-09 11:20:43 -05:00
|
|
|
static void CreateForBrowserContext(content::BrowserContext* context);
|
|
|
|
|
2017-12-05 15:59:15 +09:00
|
|
|
~SessionPreferences() override;
|
|
|
|
|
2025-01-31 09:46:17 -05:00
|
|
|
std::vector<PreloadScript>& preload_scripts() { return preload_scripts_; }
|
2017-12-05 15:59:15 +09:00
|
|
|
|
2025-02-05 14:18:24 -05:00
|
|
|
bool HasServiceWorkerPreloadScript();
|
|
|
|
|
2017-12-05 15:59:15 +09:00
|
|
|
private:
|
2023-06-09 11:20:43 -05:00
|
|
|
SessionPreferences();
|
|
|
|
|
2017-12-05 15:59:15 +09:00
|
|
|
// The user data key.
|
|
|
|
static int kLocatorKey;
|
|
|
|
|
2025-01-31 09:46:17 -05:00
|
|
|
std::vector<PreloadScript> preload_scripts_;
|
2017-12-05 15:59:15 +09:00
|
|
|
};
|
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
} // namespace electron
|
2017-12-05 15:59:15 +09:00
|
|
|
|
2021-11-22 08:34:31 +01:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_SESSION_PREFERENCES_H_
|