fix: check guest view's devtools window size (#14922)

This commit is contained in:
Cheng Zhao 2018-10-02 23:56:33 +09:00 committed by Charles Kerr
parent b23c389f89
commit 74badfeb56

View file

@ -215,8 +215,6 @@ InspectableWebContentsImpl::InspectableWebContentsImpl(
is_guest_(is_guest),
view_(CreateInspectableContentsView(this)),
weak_factory_(this) {
if (is_guest)
return;
auto* bounds_dict = pref_service_->GetDictionary(kDevToolsBoundsPref);
if (bounds_dict) {
DictionaryToRect(*bounds_dict, &devtools_bounds_);
@ -227,7 +225,7 @@ InspectableWebContentsImpl::InspectableWebContentsImpl(
}
if (!IsPointInScreen(devtools_bounds_.origin())) {
gfx::Rect display;
if (web_contents->GetNativeView()) {
if (!is_guest && web_contents->GetNativeView()) {
display = display::Screen::GetScreen()
->GetDisplayNearestView(web_contents->GetNativeView())
.bounds();