refactor: move draggable regions to WebContents (#36230)

This commit is contained in:
Jeremy Rose 2022-11-07 10:15:57 -08:00 committed by GitHub
parent 2008c9a5d0
commit 184ac2b382
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 96 additions and 202 deletions

View file

@ -77,6 +77,8 @@ class Arguments;
class ExclusiveAccessManager;
class SkRegion;
namespace electron {
class ElectronBrowserContext;
@ -438,6 +440,8 @@ class WebContents : public ExclusiveAccessContext,
// content::RenderWidgetHost::InputEventObserver:
void OnInputEvent(const blink::WebInputEvent& event) override;
SkRegion* draggable_region() { return draggable_region_.get(); }
// disable copy
WebContents(const WebContents&) = delete;
WebContents& operator=(const WebContents&) = delete;
@ -819,6 +823,8 @@ class WebContents : public ExclusiveAccessContext,
// Stores the frame thats currently in fullscreen, nullptr if there is none.
content::RenderFrameHost* fullscreen_frame_ = nullptr;
std::unique_ptr<SkRegion> draggable_region_;
base::WeakPtrFactory<WebContents> weak_factory_{this};
};