Add "will-navigate" event for WebContents
This commit is contained in:
parent
fd596d4a65
commit
60df32aab5
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue