]> khamidou — GitHub mirrors - electron.git/commitdiff
Simplify global-shortcut's code.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 22 Aug 2014 02:53:37 +0000 (10:53 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 22 Aug 2014 02:53:37 +0000 (10:53 +0800)
atom/browser/api/atom_api_global_shortcut.cc

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