Thanks for your reply. I will try to be more specific as to what I am trying achieve. I am modifying the Chromium code and not writing an extension.
This is the code I have:
NavigationController* tab = content::Source<NavigationController>(source).ptr();
int referrer_tab = -1 ;
if(tab->GetWebContents()->HasOpener()) {
WebContents* opener = browser_->tab_strip_model()->GetOpenerOfWebContentsAt(tabindex) ;
referrer_tab = browser_->tab_strip_model()->GetIndexOfWebContents(opener) ;
}
This code used to work fine in Chromium 32.x. In Chromium 32.x, if a tab was opened from another tab then I was able to get the tab id of the opener tab using the above code. When I updated to Chromium 51.x, this code always gives back tab->GetWebContents()->HasOpener() as false.
I am trying to figure out how to get the opener tab id in the above manner.
Thanks in advance for your help.