]> khamidou — GitHub mirrors - electron.git/commitdiff
Calling delegate methods should pass command id of menu item.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 16 May 2013 07:32:37 +0000 (15:32 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 16 May 2013 07:32:37 +0000 (15:32 +0800)
browser/api/atom_api_menu.cc

index 2ff18cf0deb5b7ca51d15dbd43b30d14e3e367fa..291c661d7061ad00f9f56a8f695630c3493694b1 100644 (file)
@@ -45,8 +45,10 @@ v8::Handle<v8::Value> CallDelegate(v8::Handle<v8::Value> default_value,
   if (!function->IsFunction())
     return default_value;
 
+  v8::Handle<v8::Value> 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