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
|
@ -120,6 +120,10 @@ void BrowserView::SetBounds(const gfx::Rect& bounds) {
|
|||
view_->SetBounds(bounds);
|
||||
}
|
||||
|
||||
gfx::Rect BrowserView::GetBounds() {
|
||||
return view_->GetBounds();
|
||||
}
|
||||
|
||||
void BrowserView::SetBackgroundColor(const std::string& color_name) {
|
||||
view_->SetBackgroundColor(ParseHexColor(color_name));
|
||||
}
|
||||
|
@ -140,6 +144,7 @@ void BrowserView::BuildPrototype(v8::Isolate* isolate,
|
|||
.MakeDestroyable()
|
||||
.SetMethod("setAutoResize", &BrowserView::SetAutoResize)
|
||||
.SetMethod("setBounds", &BrowserView::SetBounds)
|
||||
.SetMethod("getBounds", &BrowserView::GetBounds)
|
||||
.SetMethod("setBackgroundColor", &BrowserView::SetBackgroundColor)
|
||||
.SetProperty("webContents", &BrowserView::GetWebContents)
|
||||
.SetProperty("id", &BrowserView::ID);
|
||||
|
|
|
@ -59,6 +59,7 @@ class BrowserView : public mate::TrackableObject<BrowserView>,
|
|||
|
||||
void SetAutoResize(AutoResizeFlags flags);
|
||||
void SetBounds(const gfx::Rect& bounds);
|
||||
gfx::Rect GetBounds();
|
||||
void SetBackgroundColor(const std::string& color_name);
|
||||
|
||||
v8::Local<v8::Value> GetWebContents();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue