Show label for offscreen webview

This commit is contained in:
Cheng Zhao 2016-08-04 16:35:09 +09:00
parent e644e883ba
commit 1a80cb22b7
3 changed files with 13 additions and 5 deletions

View file

@ -224,11 +224,11 @@ InspectableWebContentsImpl::InspectableWebContentsImpl(
gfx::Rect display;
if (web_contents->GetNativeView()) {
display = display::Screen::GetScreen()->
GetDisplayNearestWindow(web_contents->GetNativeView()).bounds();
GetDisplayNearestWindow(web_contents->GetNativeView()).bounds();
} else {
display = display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
}
devtools_bounds_.set_x(display.x() + (display.width() - devtools_bounds_.width()) / 2);
devtools_bounds_.set_y(display.y() + (display.height() - devtools_bounds_.height()) / 2);
}