fix: draggable regions calculation in BrowserWindow/BrowserView (#26690)

This commit is contained in:
Shelley Vohr 2020-11-30 21:02:04 -08:00 committed by GitHub
parent 4e3e3d414d
commit acfbbe9869
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 37 deletions

View file

@ -40,6 +40,10 @@ class NativeBrowserView : public content::WebContentsObserver {
return inspectable_web_contents_;
}
const std::vector<mojom::DraggableRegionPtr>& GetDraggableRegions() const {
return draggable_regions_;
}
InspectableWebContentsView* GetInspectableWebContentsView();
virtual void SetAutoResizeFlags(uint8_t flags) = 0;
@ -47,6 +51,9 @@ class NativeBrowserView : public content::WebContentsObserver {
virtual gfx::Rect GetBounds() = 0;
virtual void SetBackgroundColor(SkColor color) = 0;
virtual void UpdateDraggableRegions(
const std::vector<gfx::Rect>& drag_exclude_rects) {}
// Called when the window needs to update its draggable region.
virtual void UpdateDraggableRegions(
const std::vector<mojom::DraggableRegionPtr>& regions) {}
@ -57,6 +64,7 @@ class NativeBrowserView : public content::WebContentsObserver {
void WebContentsDestroyed() override;
InspectableWebContents* inspectable_web_contents_;
std::vector<mojom::DraggableRegionPtr> draggable_regions_;
private:
DISALLOW_COPY_AND_ASSIGN(NativeBrowserView);