Skip to content

Commit 45493ec

Browse files
committed
Event support on CDT window object
1 parent 7078298 commit 45493ec

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/nw_shell.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,14 @@ void Shell::SendEvent(const std::string& event, const std::string& arg1) {
216216
if (!arg1.empty())
217217
args.AppendString(arg1);
218218

219-
web_contents()->GetRenderViewHost()->Send(new ShellViewMsg_Object_On_Event(
220-
web_contents()->GetRoutingID(), id(), event, args));
219+
WebContents* web_contents;
220+
if (is_devtools_ && devtools_owner_.get())
221+
web_contents = devtools_owner_->web_contents();
222+
else
223+
web_contents = this->web_contents();
224+
225+
web_contents->GetRenderViewHost()->Send(new ShellViewMsg_Object_On_Event(
226+
web_contents->GetRoutingID(), id(), event, args));
221227
}
222228

223229
bool Shell::ShouldCloseWindow() {

0 commit comments

Comments
 (0)