Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
add on-tab-created event
Browse files Browse the repository at this point in the history
auditors @bbondy
  • Loading branch information
bridiver authored and bbondy committed Dec 29, 2016
1 parent 81d1620 commit b3b9896
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,20 @@ mate::Handle<WebContents> WebContents::FromTabID(v8::Isolate* isolate,
void WebContents::OnTabCreated(const mate::Dictionary& options,
base::Callback<void(content::WebContents*)> callback,
content::WebContents* tab) {
node::Environment* env = node::Environment::GetCurrent(isolate());
if (!env) {
return;
}

auto event = v8::Local<v8::Object>::Cast(
mate::Event::Create(isolate()).ToV8());

mate::EmitEvent(isolate(),
env->process_object(),
"on-tab-created",
tab,
options);

bool active = true;
options.Get("active", &active);

Expand Down

0 comments on commit b3b9896

Please sign in to comment.