From f38732507968e0e61b3de0fc828224852da9b632 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:36:18 -0700 Subject: [PATCH] fix: EyeDropper working in devtools (31-x-y) (#43895) fix: EyeDropper working in devtools (#43685) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- shell/browser/ui/inspectable_web_contents.cc | 8 ++++++++ shell/browser/ui/inspectable_web_contents.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/shell/browser/ui/inspectable_web_contents.cc b/shell/browser/ui/inspectable_web_contents.cc index e187919d8c2c..8f0ccfb2cf82 100644 --- a/shell/browser/ui/inspectable_web_contents.cc +++ b/shell/browser/ui/inspectable_web_contents.cc @@ -798,6 +798,7 @@ void InspectableWebContents::SetEyeDropperActive(bool active) { if (delegate_) delegate_->DevToolsSetEyeDropperActive(active); } + void InspectableWebContents::ShowCertificateViewer( const std::string& cert_chain) {} @@ -995,6 +996,13 @@ void InspectableWebContents::CloseContents(content::WebContents* source) { CloseDevTools(); } +std::unique_ptr InspectableWebContents::OpenEyeDropper( + content::RenderFrameHost* frame, + content::EyeDropperListener* listener) { + auto* delegate = web_contents_->GetDelegate(); + return delegate ? delegate->OpenEyeDropper(frame, listener) : nullptr; +} + void InspectableWebContents::RunFileChooser( content::RenderFrameHost* render_frame_host, scoped_refptr listener, diff --git a/shell/browser/ui/inspectable_web_contents.h b/shell/browser/ui/inspectable_web_contents.h index 19a8b3902d22..aeff9595ae7b 100644 --- a/shell/browser/ui/inspectable_web_contents.h +++ b/shell/browser/ui/inspectable_web_contents.h @@ -206,6 +206,9 @@ class InspectableWebContents bool HandleKeyboardEvent(content::WebContents*, const content::NativeWebKeyboardEvent&) override; void CloseContents(content::WebContents* source) override; + std::unique_ptr OpenEyeDropper( + content::RenderFrameHost* frame, + content::EyeDropperListener* listener) override; void RunFileChooser(content::RenderFrameHost* render_frame_host, scoped_refptr listener, const blink::mojom::FileChooserParams& params) override;