From f28e4574b038ed83e9902768b8f75e525c5406db Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 22 Aug 2014 10:53:37 +0800 Subject: [PATCH] Simplify global-shortcut's code. --- atom/browser/api/atom_api_global_shortcut.cc | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/atom/browser/api/atom_api_global_shortcut.cc b/atom/browser/api/atom_api_global_shortcut.cc index f3e46a4d405..c2adeb1c70d 100644 --- a/atom/browser/api/atom_api_global_shortcut.cc +++ b/atom/browser/api/atom_api_global_shortcut.cc @@ -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