Simplify global-shortcut's code.

This commit is contained in:
Cheng Zhao 2014-08-22 10:53:37 +08:00
parent cab546cbb7
commit f28e4574b0

View file

@ -66,22 +66,13 @@ void GlobalShortcut::UnregisterAll() {
GlobalShortcutListener::GetInstance()->UnregisterAccelerators(this); GlobalShortcutListener::GetInstance()->UnregisterAccelerators(this);
} }
// static
mate::ObjectTemplateBuilder GlobalShortcut::GetObjectTemplateBuilder( mate::ObjectTemplateBuilder GlobalShortcut::GetObjectTemplateBuilder(
v8::Isolate* isolate) { v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate) return mate::ObjectTemplateBuilder(isolate)
.SetMethod("register", .SetMethod("register", &GlobalShortcut::Register)
base::Bind(&GlobalShortcut::Register, .SetMethod("isRegistered", &GlobalShortcut::IsRegistered)
base::Unretained(this))) .SetMethod("unregister", &GlobalShortcut::Unregister)
.SetMethod("isRegistered", .SetMethod("unregisterAll", &GlobalShortcut::UnregisterAll);
base::Bind(&GlobalShortcut::IsRegistered,
base::Unretained(this)))
.SetMethod("unregister",
base::Bind(&GlobalShortcut::Unregister,
base::Unretained(this)))
.SetMethod("unregisterAll",
base::Bind(&GlobalShortcut::UnregisterAll,
base::Unretained(this)));
} }
// static // static