#include "ui/views/window/caption_button_layout_constants.h"
#include "ui/base/pointer/touch_ui_controller.h"
#include "ui/gfx/geometry/size.h"
#if BUILDFLAG(IS_CHROMEOS)
#include "chromeos/constants/chromeos_features.h"
#endif
namespace views {
int GetCaptionButtonWidth() {
#if BUILDFLAG(IS_CHROMEOS)
if (chromeos::features::IsRoundedWindowsEnabled()) {
return 36;
}
#endif
return 32;
}
gfx::Size GetCaptionButtonLayoutSize(CaptionButtonLayoutSize size) {
const int button_width = GetCaptionButtonWidth();
#if BUILDFLAG(IS_CHROMEOS)
if (chromeos::features::IsRoundedWindowsEnabled()) {
return gfx::Size(
button_width,
size == CaptionButtonLayoutSize::kBrowserCaptionMaximized ? 34 : 40);
}
#endif
if (size == CaptionButtonLayoutSize::kNonBrowserCaption) {
return gfx::Size(button_width, 32);
}
int height = ui::TouchUiController::Get()->touch_ui() ? 41 : 34;
if (size == CaptionButtonLayoutSize::kBrowserCaptionRestored) {
height += 8;
}
return gfx::Size(button_width, height);
}
}