feat: add getBounds() method for BrowserView (#19370)
* implement getBounds on mac * add Linux/Win impl * add test * add docs
This commit is contained in:
parent
c06007175f
commit
42a483ad27
9 changed files with 39 additions and 0 deletions
|
@ -201,6 +201,17 @@ void NativeBrowserViewMac::SetBounds(const gfx::Rect& bounds) {
|
|||
bounds.width(), bounds.height());
|
||||
}
|
||||
|
||||
gfx::Rect NativeBrowserViewMac::GetBounds() {
|
||||
NSView* view =
|
||||
GetInspectableWebContentsView()->GetNativeView().GetNativeNSView();
|
||||
const int superview_height =
|
||||
(view.superview) ? view.superview.frame.size.height : 0;
|
||||
return gfx::Rect(
|
||||
view.frame.origin.x,
|
||||
superview_height - view.frame.origin.y - view.frame.size.height,
|
||||
view.frame.size.width, view.frame.size.height);
|
||||
}
|
||||
|
||||
void NativeBrowserViewMac::SetBackgroundColor(SkColor color) {
|
||||
auto* view =
|
||||
GetInspectableWebContentsView()->GetNativeView().GetNativeNSView();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue