chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
void DispatchOnBeforeNavigate(content::WebContents* web_contents,
                              int render_process_id,
                              int64 frame_id,
                              bool is_main_frame,
                              int64 parent_frame_id,
                              bool parent_is_main_frame,
                              const GURL& validated_url) {
  scoped_ptr<ListValue> args(new ListValue());
  DictionaryValue* dict = new DictionaryValue();
  dict->SetInteger(keys::kTabIdKey, ExtensionTabUtil::GetTabId(web_contents));
  dict->SetString(keys::kUrlKey, validated_url.spec());
  dict->SetInteger(keys::kProcessIdKey, render_process_id);
  dict->SetInteger(keys::kFrameIdKey, GetFrameId(is_main_frame, frame_id));
  dict->SetInteger(keys::kParentFrameIdKey,
                   GetFrameId(parent_is_main_frame, parent_frame_id));
  dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
  args->Append(dict);

  DispatchEvent(web_contents->GetBrowserContext(),
                keys::kOnBeforeNavigate,
                args.Pass(),
                validated_url);
}
// Constructs and dispatches an onBeforeNavigate event.
Constructs and dispatches an onBeforeNavigate event.
Constructs and dispatches an onBeforeNavigate event .
void DispatchOnBeforeNavigate(content::WebContents* web_contents,
                              int render_process_id,
                              int64 frame_id,
                              bool is_main_frame,
                              int64 parent_frame_id,
                              bool parent_is_main_frame,
                              const GURL& validated_url) {
  scoped_ptr<ListValue> args(new ListValue());
  DictionaryValue* dict = new DictionaryValue();
  dict->SetInteger(keys::kTabIdKey, ExtensionTabUtil::GetTabId(web_contents));
  dict->SetString(keys::kUrlKey, validated_url.spec());
  dict->SetInteger(keys::kProcessIdKey, render_process_id);
  dict->SetInteger(keys::kFrameIdKey, GetFrameId(is_main_frame, frame_id));
  dict->SetInteger(keys::kParentFrameIdKey,
                   GetFrameId(parent_is_main_frame, parent_frame_id));
  dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
  args->Append(dict);
  DispatchEvent(web_contents->GetBrowserContext(),
                keys::kOnBeforeNavigate,
                args.Pass(),
                validated_url);
}
void DispatchOnBeforeNavigate ( content :: WebContents * web_contents , int render_process_id , int64 frame_id , bool is_main_frame , int64 parent_frame_id , bool parent_is_main_frame , const GURL & validated_url ) { scoped_ptr < ListValue > args ( new ListValue ( ) ) ; DictionaryValue * dict = new DictionaryValue ( ) ; dict -> SetInteger ( keys :: kTabIdKey , ExtensionTabUtil :: GetTabId ( web_contents ) ) ; dict -> SetString ( keys :: kUrlKey , validated_url . spec ( ) ) ; dict -> SetInteger ( keys :: kProcessIdKey , render_process_id ) ; dict -> SetInteger ( keys :: kFrameIdKey , GetFrameId ( is_main_frame , frame_id ) ) ; dict -> SetInteger ( keys :: kParentFrameIdKey , GetFrameId ( parent_is_main_frame , parent_frame_id ) ) ; dict -> SetDouble ( keys :: kTimeStampKey , MilliSecondsFromTime ( base :: Time :: Now ( ) ) ) ; args -> Append ( dict ) ; DispatchEvent ( web_contents -> GetBrowserContext ( ) , keys :: kOnBeforeNavigate , args . Pass ( ) , validated_url ) ; }
Constructs and dispatches an onBeforeNavigate event.
Constructs and dispatches an onBeforeNavigate event .