chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
// Constructs and dispatches an onDOMContentLoaded event.
Constructs and dispatches an onDOMContentLoaded event.
Constructs and dispatches an onDOMContentLoaded event .
void DispatchOnDOMContentLoaded(content::WebContents* web_contents,
                                const GURL& url,
                                bool is_main_frame,
                                int64 frame_id) {
  scoped_ptr<ListValue> args(new ListValue());
  DictionaryValue* dict = new DictionaryValue();
  dict->SetInteger(keys::kTabIdKey,
                   ExtensionTabUtil::GetTabId(web_contents));
  dict->SetString(keys::kUrlKey, url.spec());
  dict->SetInteger(keys::kProcessIdKey,
                   web_contents->GetRenderViewHost()->GetProcess()->GetID());
  dict->SetInteger(keys::kFrameIdKey, GetFrameId(is_main_frame, frame_id));
  dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
  args->Append(dict);
  DispatchEvent(web_contents->GetBrowserContext(),
                keys::kOnDOMContentLoaded,
                args.Pass(),
                url);
}
void DispatchOnDOMContentLoaded ( content :: WebContents * web_contents , const GURL & url , bool is_main_frame , int64 frame_id ) { scoped_ptr < ListValue > args ( new ListValue ( ) ) ; DictionaryValue * dict = new DictionaryValue ( ) ; dict -> SetInteger ( keys :: kTabIdKey , ExtensionTabUtil :: GetTabId ( web_contents ) ) ; dict -> SetString ( keys :: kUrlKey , url . spec ( ) ) ; dict -> SetInteger ( keys :: kProcessIdKey , web_contents -> GetRenderViewHost ( ) -> GetProcess ( ) -> GetID ( ) ) ; dict -> SetInteger ( keys :: kFrameIdKey , GetFrameId ( is_main_frame , frame_id ) ) ; dict -> SetDouble ( keys :: kTimeStampKey , MilliSecondsFromTime ( base :: Time :: Now ( ) ) ) ; args -> Append ( dict ) ; DispatchEvent ( web_contents -> GetBrowserContext ( ) , keys :: kOnDOMContentLoaded , args . Pass ( ) , url ) ; }
Constructs and dispatches an onDOMContentLoaded event.
Constructs and dispatches an onDOMContentLoaded event .