Skip to content

Commit 89c51aa

Browse files
clavinjkleinsc
authored andcommitted
6606232: [views] Remove DesktopWindowTreeHostWin::window_enlargement_
https://chromium-review.googlesource.com/c/chromium/src/+/6606232 |NativeWindow::GetContentMinimumSize| and |NativeWindow::GetContentMaximumSize| may be good opportunities for a refactor now.
1 parent b623043 commit 89c51aa

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

shell/browser/native_window.cc

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -72,31 +72,6 @@ struct Converter<electron::NativeWindow::TitleBarStyle> {
7272

7373
namespace electron {
7474

75-
namespace {
76-
77-
#if BUILDFLAG(IS_WIN)
78-
gfx::Size GetExpandedWindowSize(const NativeWindow* window,
79-
bool transparent,
80-
gfx::Size size) {
81-
if (!base::FeatureList::IsEnabled(
82-
views::features::kEnableTransparentHwndEnlargement) ||
83-
!transparent) {
84-
return size;
85-
}
86-
87-
gfx::Size min_size = display::win::GetScreenWin()->ScreenToDIPSize(
88-
window->GetAcceleratedWidget(), gfx::Size{64, 64});
89-
90-
// Some AMD drivers can't display windows that are less than 64x64 pixels,
91-
// so expand them to be at least that size. http://crbug.com/286609
92-
gfx::Size expanded(std::max(size.width(), min_size.width()),
93-
std::max(size.height(), min_size.height()));
94-
return expanded;
95-
}
96-
#endif
97-
98-
} // namespace
99-
10075
NativeWindow::NativeWindow(const gin_helper::Dictionary& options,
10176
NativeWindow* parent)
10277
: title_bar_style_{options.ValueOrDefault(options::kTitleBarStyle,
@@ -409,15 +384,7 @@ gfx::Size NativeWindow::GetContentMinimumSize() const {
409384
}
410385

411386
gfx::Size NativeWindow::GetContentMaximumSize() const {
412-
const auto size_constraints = GetContentSizeConstraints();
413-
gfx::Size maximum_size = size_constraints.GetMaximumSize();
414-
415-
#if BUILDFLAG(IS_WIN)
416-
if (size_constraints.HasMaximumSize())
417-
maximum_size = GetExpandedWindowSize(this, transparent(), maximum_size);
418-
#endif
419-
420-
return maximum_size;
387+
return GetContentSizeConstraints().GetMaximumSize();
421388
}
422389

423390
void NativeWindow::SetSheetOffset(const double offsetX, const double offsetY) {

0 commit comments

Comments
 (0)