devtools-opened should be emitted after devtools is opened

This commit is contained in:
Cheng Zhao 2015-09-15 09:18:22 +08:00
parent 3bf73bc455
commit 238d4add99

View file

@ -183,21 +183,21 @@ void Window::OnDevToolsFocus() {
} }
void Window::OnDevToolsOpened() { void Window::OnDevToolsOpened() {
Emit("devtools-opened");
v8::Locker locker(isolate()); v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate()); v8::HandleScope handle_scope(isolate());
auto handle = WebContents::CreateFrom( auto handle = WebContents::CreateFrom(
isolate(), api_web_contents_->GetDevToolsWebContents()); isolate(), api_web_contents_->GetDevToolsWebContents());
devtools_web_contents_.Reset(isolate(), handle.ToV8()); devtools_web_contents_.Reset(isolate(), handle.ToV8());
Emit("devtools-opened");
} }
void Window::OnDevToolsClosed() { void Window::OnDevToolsClosed() {
Emit("devtools-closed");
v8::Locker locker(isolate()); v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate()); v8::HandleScope handle_scope(isolate());
devtools_web_contents_.Reset(); devtools_web_contents_.Reset();
Emit("devtools-closed");
} }
void Window::OnExecuteWindowsCommand(const std::string& command_name) { void Window::OnExecuteWindowsCommand(const std::string& command_name) {