electron/patches/common/chromium/autofill_size_calculation.patch
Heilig Benedek ccc60a1f33 fix: enable autofill popups on mac (#16308)
* feat: enable autofill popups on mac

* fix: make popup positioning better

* fix: don't try to show popup when widget is closing or not visible

* fix: unify conditions

* refactor: use PopupViewCommon from chrome directly

* lint: mark constructor explicit

* fix: use a patch instead of dummy functions to make things compile on Windows

* chore: address review suggestions

* Update atom/browser/ui/cocoa/views_delegate_mac.mm

Co-Authored-By: brenca <benecene@gmail.com>
2019-02-11 09:38:58 -10:00

31 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Heilig Benedek <benecene@gmail.com>
Date: Wed, 30 Jan 2019 17:04:33 +0100
Subject: don't call into chrome internals for autofill popup size calculations
The default GetWindowBounds calls into chrome internal functions to
find out the size of the window - this can be overridden but even
then some methods call into the original. Let's just return an empty
gfx::Rect and do the actual job in the subclass.
diff --git a/chrome/browser/ui/autofill/popup_view_common.cc b/chrome/browser/ui/autofill/popup_view_common.cc
index 004e9cb86bee7c10f6a68cdf6ceb60bf39627e1d..c6da9a8f5c14615bf22192f540b6fd95fa1ccb0e 100644
--- a/chrome/browser/ui/autofill/popup_view_common.cc
+++ b/chrome/browser/ui/autofill/popup_view_common.cc
@@ -176,14 +176,14 @@ gfx::Rect PopupViewCommon::GetWindowBounds(gfx::NativeView container_view) {
views::Widget::GetTopLevelWidgetForNativeView(container_view);
if (widget)
return widget->GetWindowBoundsInScreen();
-
+#if 0
// If the widget is null, try to get these bounds from a browser window. This
// is common on Mac when the window is drawn using Cocoa.
gfx::NativeWindow window = platform_util::GetTopLevel(container_view);
Browser* browser = chrome::FindBrowserWithWindow(window);
if (browser)
return browser->window()->GetBounds();
-
+#endif
// If the browser is null, simply return an empty rect. The most common reason
// to end up here is that the NativeView has been destroyed externally, which
// can happen at any time. This happens fairly commonly on Windows (e.g., at