Add SetVisibleOnAllWorkspaces/IsVisibleOnAllWorkspaces API.

These two APIs are only available on OS X/Linux platforms.
This commit is contained in:
Haojian Wu 2015-03-26 14:18:37 +08:00
parent 1804466334
commit 476b61322f
8 changed files with 74 additions and 0 deletions

View file

@ -424,6 +424,16 @@ void Window::ShowDefinitionForSelection() {
}
#endif
#if defined(OS_MACOSX) || defined(OS_LINUX)
void Window::SetVisibleOnAllWorkspaces(bool visible) {
return window_->SetVisibleOnAllWorkspaces(visible);
}
bool Window::IsVisibleOnAllWorkspaces() {
return window_->IsVisibleOnAllWorkspaces();
}
#endif
mate::Handle<WebContents> Window::GetWebContents(v8::Isolate* isolate) const {
return WebContents::CreateFrom(isolate, window_->GetWebContents());
}
@ -494,6 +504,12 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("isMenuBarAutoHide", &Window::IsMenuBarAutoHide)
.SetMethod("setMenuBarVisibility", &Window::SetMenuBarVisibility)
.SetMethod("isMenuBarVisible", &Window::IsMenuBarVisible)
#if defined(OS_MACOSX) || defined(OS_LINUX)
.SetMethod("setVisibleOnAllWorkspaces",
&Window::SetVisibleOnAllWorkspaces)
.SetMethod("isVisibleOnAllWorkspaces",
&Window::IsVisibleOnAllWorkspaces)
#endif
#if defined(OS_MACOSX)
.SetMethod("showDefinitionForSelection",
&Window::ShowDefinitionForSelection)