you can find the code for buttons in component CRMCMP_IC_FRAME .
Open Pages with Flow Logic header_jscripts.js.
check function wsb_handler.
you will find code for all buttons there.
for this cancel EH_ONFORWARDCALL will be call and u can check event name from code event_name = event->get_name( ).
in method ref_event_service->raise( ref_event ). in EH_ONFORWARDCALL (line 213) .
Regards Harish Kumar