From a7248af79e6f141fc5d2f32a196ed06a2f3f8e43 Mon Sep 17 00:00:00 2001 From: Jeremy Rose Date: Wed, 31 Aug 2022 17:40:26 -0700 Subject: [PATCH] chore: remove unneeded SetBackgroundOpaque hack (#35496) --- .../api/electron_api_browser_window.cc | 29 ------------------- .../browser/api/electron_api_browser_window.h | 2 -- 2 files changed, 31 deletions(-) diff --git a/shell/browser/api/electron_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc index 00de612cecc2..33420297a50f 100644 --- a/shell/browser/api/electron_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -158,18 +158,6 @@ void BrowserWindow::RenderViewHostChanged(content::RenderViewHost* old_host, new_host->GetWidget()->AddInputEventObserver(this); } -void BrowserWindow::RenderFrameCreated( - content::RenderFrameHost* render_frame_host) { - if (!window()->transparent()) - return; - - content::RenderWidgetHostImpl* impl = content::RenderWidgetHostImpl::FromID( - render_frame_host->GetProcess()->GetID(), - render_frame_host->GetRoutingID()); - if (impl) - impl->owner_delegate()->SetBackgroundOpaque(false); -} - void BrowserWindow::DidFirstVisuallyNonEmptyPaint() { if (window()->IsClosed() || window()->IsVisible()) return; @@ -438,23 +426,6 @@ void BrowserWindow::OnDevToolsResized() { UpdateDraggableRegions(draggable_regions_); } -void BrowserWindow::SetVibrancy(v8::Isolate* isolate, - v8::Local value) { - std::string type = gin::V8ToString(isolate, value); - - auto* render_view_host = web_contents()->GetRenderViewHost(); - if (render_view_host) { - auto* impl = content::RenderWidgetHostImpl::FromID( - render_view_host->GetProcess()->GetID(), - render_view_host->GetRoutingID()); - if (impl) - impl->owner_delegate()->SetBackgroundOpaque( - type.empty() ? !window_->transparent() : false); - } - - BaseWindow::SetVibrancy(isolate, value); -} - void BrowserWindow::FocusOnWebView() { web_contents()->GetRenderViewHost()->GetWidget()->Focus(); } diff --git a/shell/browser/api/electron_api_browser_window.h b/shell/browser/api/electron_api_browser_window.h index 6bf2591771d7..6c75bed938bd 100644 --- a/shell/browser/api/electron_api_browser_window.h +++ b/shell/browser/api/electron_api_browser_window.h @@ -49,7 +49,6 @@ class BrowserWindow : public BaseWindow, // content::WebContentsObserver: void RenderViewHostChanged(content::RenderViewHost* old_host, content::RenderViewHost* new_host) override; - void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; void DidFirstVisuallyNonEmptyPaint() override; void BeforeUnloadDialogCancelled() override; void OnRendererUnresponsive(content::RenderProcessHost*) override; @@ -89,7 +88,6 @@ class BrowserWindow : public BaseWindow, void SetTopBrowserView(gin::Handle browser_view, gin_helper::Arguments* args) override; void ResetBrowserViews() override; - void SetVibrancy(v8::Isolate* isolate, v8::Local value) override; void OnWindowShow() override; void OnWindowHide() override;