diff --git a/atom/browser/api/atom_api_menu.cc b/atom/browser/api/atom_api_menu.cc
index c378e17f87297..9817fc834d411 100644
--- a/atom/browser/api/atom_api_menu.cc
+++ b/atom/browser/api/atom_api_menu.cc
@@ -41,6 +41,8 @@ void Menu::AfterInit(v8::Isolate* isolate) {
delegate.Get("isCommandIdEnabled", &is_enabled_);
delegate.Get("isCommandIdVisible", &is_visible_);
delegate.Get("getAcceleratorForCommandId", &get_accelerator_);
+ delegate.Get("shouldRegisterAcceleratorForCommandId",
+ &should_register_accelerator_);
delegate.Get("executeCommand", &execute_command_);
delegate.Get("menuWillShow", &menu_will_show_);
}
@@ -74,6 +76,12 @@ bool Menu::GetAcceleratorForCommandIdWithParams(
return mate::ConvertFromV8(isolate(), val, accelerator);
}
+bool Menu::ShouldRegisterAcceleratorForCommandId(int command_id) const {
+ v8::Locker locker(isolate());
+ v8::HandleScope handle_scope(isolate());
+ return should_register_accelerator_.Run(GetWrapper(), command_id);
+}
+
void Menu::ExecuteCommand(int command_id, int flags) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
diff --git a/atom/browser/api/atom_api_menu.h b/atom/browser/api/atom_api_menu.h
index 499263bf492b7..c6887ad22b5b5 100644
--- a/atom/browser/api/atom_api_menu.h
+++ b/atom/browser/api/atom_api_menu.h
@@ -51,6 +51,7 @@ class Menu : public mate::TrackableObject