Simplify the GuestWindowManager

Instead of recording guest explicitly in a map, we just make use of
closure for bookkeeping.
This commit is contained in:
Cheng Zhao 2014-10-28 18:51:28 +08:00
parent c71aa0995a
commit 0c21c863d7
3 changed files with 27 additions and 42 deletions

View file

@ -131,6 +131,10 @@ void Window::Close() {
window_->Close();
}
bool Window::IsClosed() {
return window_->IsClosed();
}
void Window::Focus() {
window_->Focus(true);
}
@ -379,6 +383,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("destroy", &Window::Destroy)
.SetMethod("close", &Window::Close)
.SetMethod("isClosed", &Window::IsClosed)
.SetMethod("focus", &Window::Focus)
.SetMethod("isFocused", &Window::IsFocused)
.SetMethod("show", &Window::Show)