fix: EyeDropper working in devtools (#43685)

This commit is contained in:
Shelley Vohr 2024-09-12 15:40:56 +02:00 коммит произвёл GitHub
Родитель 74b54278bf
Коммит 3c8321a987
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -784,6 +784,7 @@ void InspectableWebContents::SetEyeDropperActive(bool active) {
if (delegate_) if (delegate_)
delegate_->DevToolsSetEyeDropperActive(active); delegate_->DevToolsSetEyeDropperActive(active);
} }
void InspectableWebContents::ZoomIn() { void InspectableWebContents::ZoomIn() {
double new_level = GetNextZoomLevel(GetDevToolsZoomLevel(), false); double new_level = GetNextZoomLevel(GetDevToolsZoomLevel(), false);
SetZoomLevelForWebContents(GetDevToolsWebContents(), new_level); SetZoomLevelForWebContents(GetDevToolsWebContents(), new_level);
@ -965,6 +966,13 @@ void InspectableWebContents::CloseContents(content::WebContents* source) {
CloseDevTools(); CloseDevTools();
} }
std::unique_ptr<content::EyeDropper> InspectableWebContents::OpenEyeDropper(
content::RenderFrameHost* frame,
content::EyeDropperListener* listener) {
auto* delegate = web_contents_->GetDelegate();
return delegate ? delegate->OpenEyeDropper(frame, listener) : nullptr;
}
void InspectableWebContents::RunFileChooser( void InspectableWebContents::RunFileChooser(
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener, scoped_refptr<content::FileSelectListener> listener,

Просмотреть файл

@ -208,6 +208,9 @@ class InspectableWebContents
bool HandleKeyboardEvent(content::WebContents*, bool HandleKeyboardEvent(content::WebContents*,
const input::NativeWebKeyboardEvent&) override; const input::NativeWebKeyboardEvent&) override;
void CloseContents(content::WebContents* source) override; void CloseContents(content::WebContents* source) override;
std::unique_ptr<content::EyeDropper> OpenEyeDropper(
content::RenderFrameHost* frame,
content::EyeDropperListener* listener) override;
void RunFileChooser(content::RenderFrameHost* render_frame_host, void RunFileChooser(content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener, scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override; const blink::mojom::FileChooserParams& params) override;