chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
// Constructs and dispatches an onCreatedNavigationTarget event.
Constructs and dispatches an onCreatedNavigationTarget event.
Constructs and dispatches an onCreatedNavigationTarget event .
void DispatchOnCreatedNavigationTarget(
    content::WebContents* web_contents,
    content::BrowserContext* browser_context,
    int64 source_frame_id,
    bool source_frame_is_main_frame,
    content::WebContents* target_web_contents,
    const GURL& target_url) {
  DCHECK(ExtensionTabUtil::GetTabById(
      ExtensionTabUtil::GetTabId(target_web_contents),
      Profile::FromBrowserContext(target_web_contents->GetBrowserContext()),
      false, NULL, NULL, NULL, NULL));
  scoped_ptr<ListValue> args(new ListValue());
  DictionaryValue* dict = new DictionaryValue();
  dict->SetInteger(keys::kSourceTabIdKey,
                   ExtensionTabUtil::GetTabId(web_contents));
  dict->SetInteger(keys::kSourceProcessIdKey,
                   web_contents->GetRenderViewHost()->GetProcess()->GetID());
  dict->SetInteger(keys::kSourceFrameIdKey,
      GetFrameId(source_frame_is_main_frame, source_frame_id));
  dict->SetString(keys::kUrlKey, target_url.possibly_invalid_spec());
  dict->SetInteger(keys::kTabIdKey,
                   ExtensionTabUtil::GetTabId(target_web_contents));
  dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
  args->Append(dict);
  DispatchEvent(browser_context, keys::kOnCreatedNavigationTarget, args.Pass(),
                target_url);
}
void DispatchOnCreatedNavigationTarget ( content :: WebContents * web_contents , content :: BrowserContext * browser_context , int64 source_frame_id , bool source_frame_is_main_frame , content :: WebContents * target_web_contents , const GURL & target_url ) { DCHECK ( ExtensionTabUtil :: GetTabById ( ExtensionTabUtil :: GetTabId ( target_web_contents ) , Profile :: FromBrowserContext ( target_web_contents -> GetBrowserContext ( ) ) , false , NULL , NULL , NULL , NULL ) ) ; scoped_ptr < ListValue > args ( new ListValue ( ) ) ; DictionaryValue * dict = new DictionaryValue ( ) ; dict -> SetInteger ( keys :: kSourceTabIdKey , ExtensionTabUtil :: GetTabId ( web_contents ) ) ; dict -> SetInteger ( keys :: kSourceProcessIdKey , web_contents -> GetRenderViewHost ( ) -> GetProcess ( ) -> GetID ( ) ) ; dict -> SetInteger ( keys :: kSourceFrameIdKey , GetFrameId ( source_frame_is_main_frame , source_frame_id ) ) ; dict -> SetString ( keys :: kUrlKey , target_url . possibly_invalid_spec ( ) ) ; dict -> SetInteger ( keys :: kTabIdKey , ExtensionTabUtil :: GetTabId ( target_web_contents ) ) ; dict -> SetDouble ( keys :: kTimeStampKey , MilliSecondsFromTime ( base :: Time :: Now ( ) ) ) ; args -> Append ( dict ) ; DispatchEvent ( browser_context , keys :: kOnCreatedNavigationTarget , args . Pass ( ) , target_url ) ; }
Constructs and dispatches an onCreatedNavigationTarget event.
Constructs and dispatches an onCreatedNavigationTarget event .
// Check that the tab is already inserted into a tab strip model. This code // path is exercised by ExtensionApiTest.WebNavigationRequestOpenTab.