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)

View file

@ -130,6 +130,11 @@ class Window : public mate::EventEmitter,
void ShowDefinitionForSelection();
#endif
#if defined(OS_MACOSX) || defined(OS_LINUX)
void SetVisibleOnAllWorkspaces(bool visible);
bool IsVisibleOnAllWorkspaces();
#endif
// APIs for WebContents.
mate::Handle<WebContents> GetWebContents(v8::Isolate* isolate) const;
mate::Handle<WebContents> GetDevToolsWebContents(v8::Isolate* isolate) const;