diff --git a/shell/browser/native_window.cc b/shell/browser/native_window.cc index 1f9c4a59f1..8ee5ab8016 100644 --- a/shell/browser/native_window.cc +++ b/shell/browser/native_window.cc @@ -72,31 +72,6 @@ struct Converter { namespace electron { -namespace { - -#if BUILDFLAG(IS_WIN) -gfx::Size GetExpandedWindowSize(const NativeWindow* window, - bool transparent, - gfx::Size size) { - if (!base::FeatureList::IsEnabled( - views::features::kEnableTransparentHwndEnlargement) || - !transparent) { - return size; - } - - gfx::Size min_size = display::win::GetScreenWin()->ScreenToDIPSize( - window->GetAcceleratedWidget(), gfx::Size{64, 64}); - - // Some AMD drivers can't display windows that are less than 64x64 pixels, - // so expand them to be at least that size. http://crbug.com/286609 - gfx::Size expanded(std::max(size.width(), min_size.width()), - std::max(size.height(), min_size.height())); - return expanded; -} -#endif - -} // namespace - NativeWindow::NativeWindow(const gin_helper::Dictionary& options, NativeWindow* parent) : title_bar_style_{options.ValueOrDefault(options::kTitleBarStyle, @@ -409,15 +384,7 @@ gfx::Size NativeWindow::GetContentMinimumSize() const { } gfx::Size NativeWindow::GetContentMaximumSize() const { - const auto size_constraints = GetContentSizeConstraints(); - gfx::Size maximum_size = size_constraints.GetMaximumSize(); - -#if BUILDFLAG(IS_WIN) - if (size_constraints.HasMaximumSize()) - maximum_size = GetExpandedWindowSize(this, transparent(), maximum_size); -#endif - - return maximum_size; + return GetContentSizeConstraints().GetMaximumSize(); } void NativeWindow::SetSheetOffset(const double offsetX, const double offsetY) {