refactor: move draggable regions to WebContents (#36230)
This commit is contained in:
parent
2008c9a5d0
commit
184ac2b382
22 changed files with 96 additions and 202 deletions
|
@ -17,6 +17,7 @@
|
|||
#include "content/public/browser/desktop_media_id.h"
|
||||
#include "content/public/browser/web_contents_user_data.h"
|
||||
#include "extensions/browser/app_window/size_constraints.h"
|
||||
#include "shell/browser/draggable_region_provider.h"
|
||||
#include "shell/browser/native_window_observer.h"
|
||||
#include "shell/browser/ui/inspectable_web_contents_view.h"
|
||||
#include "shell/common/api/api.mojom.h"
|
||||
|
@ -351,11 +352,6 @@ class NativeWindow : public base::SupportsUserData,
|
|||
return fullscreen_transition_type_;
|
||||
}
|
||||
|
||||
SkRegion const* draggable_region() const { return draggable_region_.get(); }
|
||||
|
||||
void UpdateDraggableRegions(
|
||||
const std::vector<mojom::DraggableRegionPtr>& regions);
|
||||
|
||||
views::Widget* widget() const { return widget_.get(); }
|
||||
views::View* content_view() const { return content_view_; }
|
||||
|
||||
|
@ -384,12 +380,12 @@ class NativeWindow : public base::SupportsUserData,
|
|||
|
||||
std::list<NativeBrowserView*> browser_views() const { return browser_views_; }
|
||||
|
||||
std::list<InspectableWebContentsView*> inspectable_views() const {
|
||||
return inspectable_views_;
|
||||
}
|
||||
|
||||
int32_t window_id() const { return next_id_; }
|
||||
|
||||
int NonClientHitTest(const gfx::Point& point);
|
||||
void AddDraggableRegionProvider(DraggableRegionProvider* provider);
|
||||
void RemoveDraggableRegionProvider(DraggableRegionProvider* provider);
|
||||
|
||||
protected:
|
||||
friend class api::BrowserView;
|
||||
|
||||
|
@ -410,16 +406,6 @@ class NativeWindow : public base::SupportsUserData,
|
|||
[&browser_view](NativeBrowserView* n) { return (n == browser_view); });
|
||||
}
|
||||
|
||||
void add_inspectable_view(InspectableWebContentsView* inspectable_view) {
|
||||
inspectable_views_.push_back(inspectable_view);
|
||||
}
|
||||
void remove_inspectable_view(InspectableWebContentsView* inspectable_view) {
|
||||
inspectable_views_.remove_if(
|
||||
[&inspectable_view](InspectableWebContentsView* n) {
|
||||
return (n == inspectable_view);
|
||||
});
|
||||
}
|
||||
|
||||
// The boolean parsing of the "titleBarOverlay" option
|
||||
bool titlebar_overlay_ = false;
|
||||
|
||||
|
@ -483,8 +469,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
// The browser view layer.
|
||||
std::list<NativeBrowserView*> browser_views_;
|
||||
|
||||
// The inspectable webContents views.
|
||||
std::list<InspectableWebContentsView*> inspectable_views_;
|
||||
std::list<DraggableRegionProvider*> draggable_region_providers_;
|
||||
|
||||
// Observers of this window.
|
||||
base::ObserverList<NativeWindowObserver> observers_;
|
||||
|
@ -494,10 +479,6 @@ class NativeWindow : public base::SupportsUserData,
|
|||
|
||||
gfx::Rect overlay_rect_;
|
||||
|
||||
// For custom drag, the whole window is non-draggable and the draggable region
|
||||
// has to been explicitly provided.
|
||||
std::unique_ptr<SkRegion> draggable_region_; // used in custom drag.
|
||||
|
||||
base::WeakPtrFactory<NativeWindow> weak_factory_{this};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue