Emit 'execute' event when menu item is clicked.
authorCheng Zhao <zcbenz@gmail.com>
Tue, 14 May 2013 12:24:53 +0000 (20:24 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 14 May 2013 12:24:53 +0000 (20:24 +0800)
browser/api/atom_api_menu.cc

index 2aea34d..16a092a 100644 (file)
@@ -106,6 +106,11 @@ string16 Menu::GetSublabelForCommandId(int command_id) const {
 }
 
 void Menu::ExecuteCommand(int command_id, int event_flags) {
+  v8::Handle<v8::Value> args[] = {
+    v8::String::New("execute"),
+    v8::Integer::New(command_id)
+  };
+  node::MakeCallback(handle(), "emit", 2, args);
 }
 
 // static