#include "ui/ozone/platform/headless/headless_screen.h"
#include <string_view>
#include <vector>
#include "base/command_line.h"
#include "base/not_fatal_until.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "ui/display/tablet_state.h"
#include "ui/ozone/public/ozone_switches.h"
namespace ui {
namespace {
constexpr int64_t kHeadlessDisplayId = …;
constexpr float kHeadlessDisplayScale = …;
constexpr gfx::Size kHeadlessDisplaySize(1, 1);
bool ParseScreenSize(const std::string& screen_size, int* width, int* height) { … }
gfx::Rect GetDisplayBounds() { … }
}
HeadlessScreen::HeadlessScreen() { … }
HeadlessScreen::~HeadlessScreen() = default;
const std::vector<display::Display>& HeadlessScreen::GetAllDisplays() const { … }
display::Display HeadlessScreen::GetPrimaryDisplay() const { … }
display::Display HeadlessScreen::GetDisplayForAcceleratedWidget(
gfx::AcceleratedWidget widget) const { … }
gfx::Point HeadlessScreen::GetCursorScreenPoint() const { … }
gfx::AcceleratedWidget HeadlessScreen::GetAcceleratedWidgetAtScreenPoint(
const gfx::Point& point) const { … }
display::Display HeadlessScreen::GetDisplayNearestPoint(
const gfx::Point& point) const { … }
display::Display HeadlessScreen::GetDisplayMatching(
const gfx::Rect& match_rect) const { … }
void HeadlessScreen::AddObserver(display::DisplayObserver* observer) { … }
void HeadlessScreen::RemoveObserver(display::DisplayObserver* observer) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
display::TabletState HeadlessScreen::GetTabletState() const {
return display::TabletState::kInClamshellMode;
}
#endif
}