Skip to content
Snippets Groups Projects
Unverified Commit fc917985 authored by Shelley Vohr's avatar Shelley Vohr Committed by GitHub
Browse files

fix: ensure `WebContents` before checking draggable region (#41154)

fix: ensure WebContents before checking draggable region
parent ffec3127
No related merge requests found
......@@ -81,11 +81,14 @@ void WebContentsView::SetBackgroundColor(std::optional<WrappedSkColor> color) {
}
int WebContentsView::NonClientHitTest(const gfx::Point& point) {
gfx::Point local_point(point);
views::View::ConvertPointFromWidget(view(), &local_point);
SkRegion* region = api_web_contents_->draggable_region();
if (region && region->contains(local_point.x(), local_point.y()))
return HTCAPTION;
if (api_web_contents_) {
gfx::Point local_point(point);
views::View::ConvertPointFromWidget(view(), &local_point);
SkRegion* region = api_web_contents_->draggable_region();
if (region && region->contains(local_point.x(), local_point.y()))
return HTCAPTION;
}
return HTNOWHERE;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment