parent
f374508a61
commit
18de28c3ff
2 changed files with 13 additions and 4 deletions
|
@ -261,13 +261,23 @@ void Window::OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) {
|
|||
#endif
|
||||
|
||||
// static
|
||||
mate::Wrappable* Window::New(v8::Isolate* isolate,
|
||||
const mate::Dictionary& options) {
|
||||
mate::Wrappable* Window::New(v8::Isolate* isolate, mate::Arguments* args) {
|
||||
if (!Browser::Get()->is_ready()) {
|
||||
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
|
||||
isolate, "Cannot create BrowserWindow before app is ready")));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (args->Length() > 1) {
|
||||
args->ThrowError();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
mate::Dictionary options;
|
||||
if (!(args->Length() == 1 && args->GetNext(&options))) {
|
||||
options = mate::Dictionary::CreateEmpty(isolate);
|
||||
}
|
||||
|
||||
return new Window(isolate, options);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,8 +38,7 @@ class WebContents;
|
|||
class Window : public mate::TrackableObject<Window>,
|
||||
public NativeWindowObserver {
|
||||
public:
|
||||
static mate::Wrappable* New(v8::Isolate* isolate,
|
||||
const mate::Dictionary& options);
|
||||
static mate::Wrappable* New(v8::Isolate* isolate, mate::Arguments* args);
|
||||
|
||||
static void BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::ObjectTemplate> prototype);
|
||||
|
|
Loading…
Reference in a new issue