feat: add getBounds() method for BrowserView (#19370)

* implement getBounds on mac

* add Linux/Win impl

* add test

* add docs
This commit is contained in:
Micha Hanselmann 2019-07-29 19:43:05 -07:00 committed by Shelley Vohr
parent c06007175f
commit 42a483ad27
9 changed files with 39 additions and 0 deletions

View file

@ -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);