fix for offscreen and added khronos

This commit is contained in:
Heilig Benedek 2016-07-28 02:11:57 +02:00
parent c00dfcdd6a
commit 97b153fce6
2 changed files with 8 additions and 1 deletions

View file

@ -29,6 +29,7 @@
'<(libchromiumcontent_src_dir)/third_party/skia/include/config',
'<(libchromiumcontent_src_dir)/third_party/icu/source/common',
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
'<(libchromiumcontent_src_dir)/third_party/khronos',
'<(libchromiumcontent_src_dir)/third_party/WebKit',
'<(libchromiumcontent_dir)/gen',
],

View file

@ -221,8 +221,14 @@ InspectableWebContentsImpl::InspectableWebContentsImpl(
devtools_bounds_.set_width(800);
}
if (!IsPointInScreen(devtools_bounds_.origin())) {
gfx::Rect display = display::Screen::GetScreen()->
gfx::Rect display;
if (web_contents->GetNativeView()) {
display = display::Screen::GetScreen()->
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);
}