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.
|
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#ifndef SHELL_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
|
|
|
|
#define 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;
|
|
|
|
|
|
|
|
// blink::WebContentSettingsClient implementation.
|
2020-09-21 08:00:36 +00:00
|
|
|
bool AllowStorageAccessSync(StorageType storage_type) override;
|
2017-06-16 20:42:33 +00:00
|
|
|
bool AllowStorage(bool local) override;
|
2016-09-21 16:17:30 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// content::RenderFrameObserver implementation.
|
|
|
|
void OnDestruct() override;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver);
|
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2016-09-21 16:17:30 +00:00
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#endif // SHELL_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
|