fix datalist element popup position when menu is hidden

This commit is contained in:
Heilig Benedek 2017-11-03 00:25:59 +01:00 committed by Cheng Zhao
parent f8b3009ebf
commit 193beb57c9
3 changed files with 25 additions and 17 deletions

View file

@ -1367,13 +1367,14 @@ void NativeWindowViews::ShowAutofillPopup(
bool isOffsceen = web_preferences->IsOffScreen(web_contents());
bool isEmbedderOffscreen = web_preferences->IsGuest(web_contents()) &&
web_preferences->IsOffScreen(web_preferences->Embedder(web_contents()));
autofill_popup_->CreateView(
frame_host,
isOffsceen || isEmbedderOffscreen,
widget(),
bounds);
autofill_popup_->SetItems(values, labels);
autofill_popup_->UpdatePopupBounds(menu_bar_visible_ ? 0 : kMenuBarHeight);
}
void NativeWindowViews::HideAutofillPopup(
@ -1395,6 +1396,9 @@ void NativeWindowViews::Layout() {
gfx::Rect(0, menu_bar_bounds.height(), size.width(),
size.height() - menu_bar_bounds.height()));
}
if (autofill_popup_.get())
autofill_popup_->UpdatePopupBounds(menu_bar_visible_ ? 0 : kMenuBarHeight);
}
gfx::Size NativeWindowViews::GetMinimumSize() const {