From 5d985aae092826c2663ac78bb57fabfd91b9d034 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 16 May 2013 15:32:37 +0800 Subject: [PATCH] Calling delegate methods should pass command id of menu item. --- browser/api/atom_api_menu.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/api/atom_api_menu.cc b/browser/api/atom_api_menu.cc index 2ff18cf0..291c661d 100644 --- a/browser/api/atom_api_menu.cc +++ b/browser/api/atom_api_menu.cc @@ -45,8 +45,10 @@ v8::Handle CallDelegate(v8::Handle default_value, if (!function->IsFunction()) return default_value; + v8::Handle argv = v8::Integer::New(command_id); + return scope.Close( - function->Call(v8::Context::GetCurrent()->Global(), 0, NULL)); + function->Call(v8::Context::GetCurrent()->Global(), 1, &argv)); } } // namespace -- 2.43.0