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:
Robo
2025-02-05 15:13:29 +09:00
committed by GitHub
parent e9d5eeb118
commit bec6ddda70
30 changed files with 441 additions and 35 deletions

View File

@@ -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