Make Wrappable a template class
This commit is contained in:
parent
a8f08e1fab
commit
2ae52d0ff4
52 changed files with 367 additions and 349 deletions
|
@ -194,10 +194,11 @@ int ImportIntoCertStore(
|
|||
|
||||
} // namespace
|
||||
|
||||
App::App() {
|
||||
App::App(v8::Isolate* isolate) {
|
||||
static_cast<AtomBrowserClient*>(AtomBrowserClient::Get())->set_delegate(this);
|
||||
Browser::Get()->AddObserver(this);
|
||||
content::GpuDataManager::GetInstance()->AddObserver(this);
|
||||
Init(isolate);
|
||||
}
|
||||
|
||||
App::~App() {
|
||||
|
@ -439,10 +440,16 @@ void App::OnCertificateManagerModelCreated(
|
|||
}
|
||||
#endif
|
||||
|
||||
mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
||||
v8::Isolate* isolate) {
|
||||
// static
|
||||
mate::Handle<App> App::Create(v8::Isolate* isolate) {
|
||||
return CreateHandle(isolate, new App(isolate));
|
||||
}
|
||||
|
||||
// static
|
||||
void App::BuildPrototype(
|
||||
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
|
||||
auto browser = base::Unretained(Browser::Get());
|
||||
return mate::ObjectTemplateBuilder(isolate)
|
||||
mate::ObjectTemplateBuilder(isolate, prototype)
|
||||
.SetMethod("quit", base::Bind(&Browser::Quit, browser))
|
||||
.SetMethod("exit", base::Bind(&Browser::Exit, browser))
|
||||
.SetMethod("focus", base::Bind(&Browser::Focus, browser))
|
||||
|
@ -484,11 +491,6 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
|||
.SetMethod("makeSingleInstance", &App::MakeSingleInstance);
|
||||
}
|
||||
|
||||
// static
|
||||
mate::Handle<App> App::Create(v8::Isolate* isolate) {
|
||||
return CreateHandle(isolate, new App);
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
||||
} // namespace atom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue