Add "will-navigate" event for WebContents

This commit is contained in:
Cheng Zhao 2014-12-17 14:55:22 -08:00
parent fd596d4a65
commit 60df32aab5

View file

@ -111,9 +111,15 @@ content::WebContents* WebContents::OpenURLFromTab(
args.AppendString("");
args.AppendInteger(params.disposition);
Emit("-new-window", args);
return NULL;
return nullptr;
}
// Give user a chance to cancel navigation.
base::ListValue args;
args.AppendString(params.url.spec());
if (Emit("will-navigate", args))
return nullptr;
content::NavigationController::LoadURLParams load_url_params(params.url);
load_url_params.referrer = params.referrer;
load_url_params.transition_type = params.transition;