Move AutofillPopup from NativeWindow to WebContents (#12514)

This commit is contained in:
Cheng Zhao 2018-04-05 09:53:51 +09:00 committed by GitHub
parent 3a45d541f3
commit c75dd93b92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 123 additions and 126 deletions

View file

@ -27,6 +27,26 @@ void CommonWebContentsDelegate::HandleKeyboardEvent(
owner_window()->HandleKeyboardEvent(source, event);
}
void CommonWebContentsDelegate::ShowAutofillPopup(
bool offscreen,
content::RenderFrameHost* frame_host,
const gfx::RectF& bounds,
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
if (!owner_window())
return;
auto* window = static_cast<NativeWindowViews*>(owner_window());
autofill_popup_->CreateView(
frame_host, offscreen, window->web_view(), bounds);
autofill_popup_->SetItems(values, labels);
}
void CommonWebContentsDelegate::HideAutofillPopup() {
if (autofill_popup_)
autofill_popup_->Hide();
}
gfx::ImageSkia CommonWebContentsDelegate::GetDevToolsWindowIcon() {
if (!owner_window())
return gfx::ImageSkia();