#include "ash/wallpaper/wallpaper_utils/wallpaper_resolution.h"
#include "ash/public/cpp/wallpaper/wallpaper_types.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gfx/geometry/size.h"
namespace ash {
gfx::Size GetMaxDisplaySizeInNative() {
if (!display::Screen::Get()) {
return gfx::Size();
}
gfx::Size max;
for (const auto& display : display::Screen::Get()->GetAllDisplays()) {
max.SetToMax(display.GetSizeInPixel());
}
return max;
}
WallpaperResolution GetAppropriateResolution() {
gfx::Size size = GetMaxDisplaySizeInNative();
return (size.width() > kSmallWallpaperMaxWidth ||
size.height() > kSmallWallpaperMaxHeight)
? WallpaperResolution::kLarge
: WallpaperResolution::kSmall;
}
}