2016-09-21 16:17:30 +00:00
|
|
|
// Copyright (c) 2016 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_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
|
|
|
|
#define ELECTRON_SHELL_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
|
2016-09-21 16:17:30 +00:00
|
|
|
|
|
|
|
#include "base/compiler_specific.h"
|
|
|
|
#include "content/public/renderer/render_frame_observer.h"
|
2018-07-20 16:08:18 +00:00
|
|
|
#include "third_party/blink/public/platform/web_content_settings_client.h"
|
2016-09-21 16:17:30 +00:00
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2016-09-21 16:17:30 +00:00
|
|
|
|
|
|
|
class ContentSettingsObserver : public content::RenderFrameObserver,
|
|
|
|
public blink::WebContentSettingsClient {
|
|
|
|
public:
|
|
|
|
explicit ContentSettingsObserver(content::RenderFrame* render_frame);
|
|
|
|
~ContentSettingsObserver() override;
|
|
|
|
|
2021-11-03 11:41:45 +00:00
|
|
|
// disable copy
|
|
|
|
ContentSettingsObserver(const ContentSettingsObserver&) = delete;
|
|
|
|
ContentSettingsObserver& operator=(const ContentSettingsObserver&) = delete;
|
|
|
|
|
2016-09-21 16:17:30 +00:00
|
|
|
// blink::WebContentSettingsClient implementation.
|
2020-09-21 08:00:36 +00:00
|
|
|
bool AllowStorageAccessSync(StorageType storage_type) override;
|
2016-09-21 16:17:30 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// content::RenderFrameObserver implementation.
|
|
|
|
void OnDestruct() override;
|
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2016-09-21 16:17:30 +00:00
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
|