mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: handle nullish WebContentsView in UpdateDraggableRegions (#30559)
* fix: handle nullish WebContentsView in UpdateDraggableRegions * build: nogncheck on webcontentsimpl include Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "shell/browser/api/electron_api_browser_window.h"
|
||||
|
||||
#include "content/browser/web_contents/web_contents_impl.h" // nogncheck
|
||||
#include "shell/browser/native_window_views.h"
|
||||
#include "ui/aura/window.h"
|
||||
|
||||
@@ -17,8 +18,10 @@ void BrowserWindow::UpdateDraggableRegions(
|
||||
return;
|
||||
|
||||
if (&draggable_regions_ != ®ions) {
|
||||
auto* nv = web_contents()->GetNativeView();
|
||||
if (nv) {
|
||||
auto* view =
|
||||
static_cast<content::WebContentsImpl*>(web_contents())->GetView();
|
||||
if (view) {
|
||||
const gfx::NativeView nv = view->GetNativeView();
|
||||
auto const offset = nv->GetBoundsInRootWindow();
|
||||
auto snapped_regions = mojo::Clone(regions);
|
||||
for (auto& snapped_region : snapped_regions) {
|
||||
|
||||
Reference in New Issue
Block a user