feat: replace BrowserView with WebContentsView (#35658)

This commit is contained in:
Jeremy Rose 2023-12-13 13:01:03 -08:00 committed by GitHub
parent a94fb2cb5d
commit 15c6014324
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 2987 additions and 1531 deletions

View file

@ -11,7 +11,6 @@
#include "content/public/browser/render_widget_host_view.h"
#include "shell/browser/api/electron_api_web_contents.h"
#include "shell/browser/javascript_environment.h"
#include "shell/browser/native_browser_view.h"
#include "shell/browser/native_window.h"
namespace electron {
@ -60,21 +59,6 @@ void AutofillDriver::ShowAutofillPopup(
embedder_frame_host = embedder->web_contents()->GetPrimaryMainFrame();
}
// Ensure that if the WebContents belongs to a BrowserView,
// the popup is positioned relative to the BrowserView's bounds.
for (NativeBrowserView* bv : owner_window->browser_views()) {
auto* iwc = bv->GetInspectableWebContents();
if (!iwc)
continue;
auto* awc = api::WebContents::From(iwc->GetWebContents());
if (awc == web_contents) {
auto bv_origin = bv->GetBounds().origin();
popup_bounds.Offset(gfx::Vector2dF(bv_origin.x(), bv_origin.y()));
break;
}
}
autofill_popup_->CreateView(render_frame_host_, embedder_frame_host, osr,
owner_window->content_view(), popup_bounds);
autofill_popup_->SetItems(values, labels);