From: Cheng Zhao Date: Thu, 16 May 2013 07:32:37 +0000 (+0800) Subject: Calling delegate methods should pass command id of menu item. X-Git-Tag: v0.1.0~164 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=5d985aae092826c2663ac78bb57fabfd91b9d034;p=electron.git Calling delegate methods should pass command id of menu item. --- 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