From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Heilig Benedek 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..a78dc65c413ce72d31a364e1b36dbe067cf579d7 100644 --- a/chrome/browser/ui/autofill/popup_view_common.cc +++ b/chrome/browser/ui/autofill/popup_view_common.cc @@ -8,9 +8,11 @@ #include #include "build/build_config.h" +#if 0 #include "chrome/browser/platform_util.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" +#endif #include "ui/gfx/geometry/vector2d.h" #if defined(OS_ANDROID) @@ -176,14 +178,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