mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: route deprecated sync clipboard read through permission checks (#45377)
* feat: route deprecated clipboard commands through permission checks * docs: address review feedback * fix: enable checks for child windows
This commit is contained in:
@@ -6,7 +6,10 @@
|
||||
#define ELECTRON_SHELL_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
|
||||
|
||||
#include "content/public/renderer/render_frame_observer.h"
|
||||
#include "mojo/public/cpp/bindings/associated_remote.h"
|
||||
#include "shell/common/web_contents_utility.mojom.h"
|
||||
#include "third_party/blink/public/platform/web_content_settings_client.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
@@ -22,10 +25,17 @@ class ContentSettingsObserver : public content::RenderFrameObserver,
|
||||
|
||||
// blink::WebContentSettingsClient implementation.
|
||||
bool AllowStorageAccessSync(StorageType storage_type) override;
|
||||
bool AllowReadFromClipboardSync() override;
|
||||
|
||||
private:
|
||||
// content::RenderFrameObserver implementation.
|
||||
void OnDestruct() override;
|
||||
|
||||
// A getter for `content_settings_manager_` that ensures it is bound.
|
||||
mojom::ElectronWebContentsUtility& GetWebContentsUtility();
|
||||
|
||||
mojo::AssociatedRemote<mojom::ElectronWebContentsUtility>
|
||||
web_contents_utility_;
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
||||
Reference in New Issue
Block a user