diff --git a/brightray/browser/win/devtools_window.cc b/brightray/browser/win/devtools_window.cc index 442bffa13cc1..9fc4b5dba886 100644 --- a/brightray/browser/win/devtools_window.cc +++ b/brightray/browser/win/devtools_window.cc @@ -8,7 +8,8 @@ namespace brightray { -DevToolsWindow* DevToolsWindow::Create(InspectableWebContentsViewWin* controller) { +DevToolsWindow* DevToolsWindow::Create( + InspectableWebContentsViewWin* controller) { return new DevToolsWindow(controller); } @@ -20,13 +21,18 @@ DevToolsWindow::~DevToolsWindow() { } LRESULT DevToolsWindow::OnCreate(UINT, WPARAM, LPARAM, BOOL&) { - SetParent(controller_->inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(), hwnd()); + auto devtools_web_contents = + controller_->inspectable_web_contents()->devtools_web_contents(); + SetParent(devtools_web_contents->GetView()->GetNativeView(), hwnd()); SetWindowText(hwnd(), L"Developer Tools"); return 0; } LRESULT DevToolsWindow::OnDestroy(UINT, WPARAM, LPARAM, BOOL&) { - SetParent(controller_->inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(), ui::GetHiddenWindow()); + auto devtools_web_contents = + controller_->inspectable_web_contents()->devtools_web_contents(); + SetParent( + devtools_web_contents->GetView()->GetNativeView(), ui::GetHiddenWindow()); delete this; return 0; } @@ -35,7 +41,9 @@ LRESULT DevToolsWindow::OnSize(UINT, WPARAM, LPARAM, BOOL&) { RECT rect; GetClientRect(hwnd(), &rect); - SetWindowPos(controller_->inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(), + auto devtools_web_contents = + controller_->inspectable_web_contents()->devtools_web_contents(); + SetWindowPos(devtools_web_contents->GetView()->GetNativeView(), nullptr, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,