#include "extensions/browser/api/system_display/display_info_provider.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "extensions/browser/api/extensions_api_client.h"
#include "extensions/browser/extensions_browser_client.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
namespace extensions {
namespace {
DisplayInfoProvider* g_display_info_provider = …;
int RotationToDegrees(display::Display::Rotation rotation) { … }
}
DisplayInfoProvider::DisplayInfoProvider(display::Screen* screen)
: … { … }
DisplayInfoProvider::~DisplayInfoProvider() = default;
DisplayInfoProvider* DisplayInfoProvider::Get() { … }
void DisplayInfoProvider::InitializeForTesting(
DisplayInfoProvider* display_info_provider) { … }
void DisplayInfoProvider::ResetForTesting() { … }
api::system_display::DisplayUnitInfo DisplayInfoProvider::CreateDisplayUnitInfo(
const display::Display& display,
int64_t primary_display_id) { … }
void DisplayInfoProvider::SetDisplayProperties(
const std::string& display_id,
const api::system_display::DisplayProperties& properties,
ErrorCallback callback) { … }
void DisplayInfoProvider::SetDisplayLayout(const DisplayLayoutList& layouts,
ErrorCallback callback) { … }
void DisplayInfoProvider::EnableUnifiedDesktop(bool enable) { … }
DisplayInfoProvider::DisplayUnitInfoList
DisplayInfoProvider::GetAllDisplaysInfoList(
const std::vector<display::Display>& displays,
int64_t primary_id) const { … }
void DisplayInfoProvider::GetAllDisplaysInfo(
bool ,
base::OnceCallback<void(DisplayUnitInfoList result)> callback) { … }
void DisplayInfoProvider::GetDisplayLayout(
base::OnceCallback<void(DisplayLayoutList result)> callback) { … }
void DisplayInfoProvider::StartObserving() { … }
void DisplayInfoProvider::StopObserving() { … }
bool DisplayInfoProvider::OverscanCalibrationStart(const std::string& id) { … }
bool DisplayInfoProvider::OverscanCalibrationAdjust(
const std::string& id,
const api::system_display::Insets& delta) { … }
bool DisplayInfoProvider::OverscanCalibrationReset(const std::string& id) { … }
bool DisplayInfoProvider::OverscanCalibrationComplete(const std::string& id) { … }
void DisplayInfoProvider::ShowNativeTouchCalibration(const std::string& id,
ErrorCallback callback) { … }
bool DisplayInfoProvider::StartCustomTouchCalibration(const std::string& id) { … }
bool DisplayInfoProvider::CompleteCustomTouchCalibration(
const api::system_display::TouchCalibrationPairQuad& pairs,
const api::system_display::Bounds& bounds) { … }
bool DisplayInfoProvider::ClearTouchCalibration(const std::string& id) { … }
void DisplayInfoProvider::SetMirrorMode(
const api::system_display::MirrorModeInfo& info,
ErrorCallback callback) { … }
void DisplayInfoProvider::DispatchOnDisplayChangedEvent() { … }
void DisplayInfoProvider::UpdateDisplayUnitInfoForPlatform(
const std::vector<display::Display>& displays,
DisplayUnitInfoList& units) const { … }
void DisplayInfoProvider::OnDisplayAdded(const display::Display& new_display) { … }
void DisplayInfoProvider::OnDisplaysRemoved(
const display::Displays& removed_displays) { … }
void DisplayInfoProvider::OnDisplayMetricsChanged(
const display::Display& display,
uint32_t metrics) { … }
}