feat: programmatically modify traffic light positioning (#22533)

* setter

* getter

* specs and docs

* fixup

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
Samuel Attard 2020-03-05 14:22:12 -08:00 committed by GitHub
parent 1811751c6c
commit 3e2cec83d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 80 additions and 5 deletions

View file

@ -814,6 +814,16 @@ void TopLevelWindow::SetVibrancy(v8::Isolate* isolate,
window_->SetVibrancy(type);
}
#if defined(OS_MACOSX)
void TopLevelWindow::SetTrafficLightPosition(const gfx::Point& position) {
window_->SetTrafficLightPosition(position);
}
gfx::Point TopLevelWindow::GetTrafficLightPosition() const {
return window_->GetTrafficLightPosition();
}
#endif
void TopLevelWindow::SetTouchBar(
std::vector<gin_helper::PersistentDictionary> items) {
window_->SetTouchBar(std::move(items));
@ -1184,6 +1194,12 @@ void TopLevelWindow::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setAutoHideCursor", &TopLevelWindow::SetAutoHideCursor)
#endif
.SetMethod("setVibrancy", &TopLevelWindow::SetVibrancy)
#if defined(OS_MACOSX)
.SetMethod("setTrafficLightPosition",
&TopLevelWindow::SetTrafficLightPosition)
.SetMethod("getTrafficLightPosition",
&TopLevelWindow::GetTrafficLightPosition)
#endif
.SetMethod("_setTouchBarItems", &TopLevelWindow::SetTouchBar)
.SetMethod("_refreshTouchBarItem", &TopLevelWindow::RefreshTouchBarItem)
.SetMethod("_setEscapeTouchBarItem",