From 5b4a42f7e9539fa66dad132dc3965ea024046efa Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 4 Aug 2015 22:50:30 +0800 Subject: [PATCH] Show devtools window in the middle of display --- brightray/browser/inspectable_web_contents_impl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 006986af6103..c3df837943e9 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -183,8 +183,8 @@ InspectableWebContentsImpl::InspectableWebContentsImpl( gfx::Rect display = gfx::Screen::GetNativeScreen() ->GetDisplayNearestWindow(web_contents->GetNativeView()).bounds(); if (!IsPointInRect(devtools_bounds_.origin(), display)) { - devtools_bounds_.set_x(0); - devtools_bounds_.set_y(0); + devtools_bounds_.set_x(display.x() + (display.width() - devtools_bounds_.width()) / 2); + devtools_bounds_.set_y(display.y() + (display.height() - devtools_bounds_.height()) / 2); } }