chromium/extensions/browser/api/system_display/system_display_api.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "extensions/browser/api/system_display/system_display_api.h"

#include <map>
#include <memory>
#include <set>
#include <string>

#include "base/functional/bind.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "extensions/browser/api/system_display/display_info_provider.h"
#include "extensions/common/mojom/context_type.mojom.h"
#include "extensions/common/permissions/permissions_data.h"

#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "extensions/common/manifest_handlers/kiosk_mode_info.h"
#endif

namespace extensions {

display;

const char SystemDisplayFunction::kApiNotAvailableError[] =;

const char SystemDisplayCrOSRestrictedFunction::kCrosOnlyError[] =;
const char SystemDisplayCrOSRestrictedFunction::kKioskOnlyError[] =;

namespace {

class OverscanTracker;

// Singleton class to track overscan calibration overlays. An observer is
// created per WebContents which tracks any calbiration overlays by id.
// If the primary main render frame is deleted (e.g. the tab is closed)
// before the overlay calibraiton is completed, the observer will call the
// overscan complete method to remove the overlay. When all observers are
// removed, the singleton tracker will delete itself.
class OverscanTracker {};

class OverscanTracker::OverscanWebObserver
    : public content::WebContentsObserver {};

static OverscanTracker* g_overscan_tracker =;

// static
void OverscanTracker::AddDisplay(content::WebContents* web_contents,
                                 const std::string& id) {}

// static
void OverscanTracker::RemoveDisplay(content::WebContents* web_contents,
                                    const std::string& id) {}

// static
void OverscanTracker::RemoveObserver(content::WebContents* web_contents) {}

OverscanTracker::OverscanWebObserver* OverscanTracker::GetObserver(
    content::WebContents* web_contents,
    bool create) {}

bool OverscanTracker::RemoveObserverImpl(content::WebContents* web_contents) {}

bool HasAutotestPrivate(const ExtensionFunction& function) {}

#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
// |edid| is available only to Chrome OS kiosk mode applications.
bool ShouldRestrictEdidInformation(const ExtensionFunction& function) {
  if (function.extension()) {
    return !(HasAutotestPrivate(function) ||
             KioskModeInfo::IsKioskEnabled(function.extension()));
  }

  return function.source_context_type() != mojom::ContextType::kWebUi;
}
#endif

}  // namespace

bool SystemDisplayFunction::PreRunValidation(std::string* error) {}

bool SystemDisplayCrOSRestrictedFunction::PreRunValidation(std::string* error) {}

bool SystemDisplayCrOSRestrictedFunction::ShouldRestrictToKioskAndWebUI() {}

ExtensionFunction::ResponseAction SystemDisplayGetInfoFunction::Run() {}

void SystemDisplayGetInfoFunction::Response(
    std::vector<api::system_display::DisplayUnitInfo> all_displays_info) {}

ExtensionFunction::ResponseAction SystemDisplayGetDisplayLayoutFunction::Run() {}

void SystemDisplayGetDisplayLayoutFunction::Response(
    std::vector<api::system_display::DisplayLayout> display_layout) {}

bool SystemDisplayGetDisplayLayoutFunction::ShouldRestrictToKioskAndWebUI() {}

ExtensionFunction::ResponseAction
SystemDisplaySetDisplayPropertiesFunction::Run() {}

void SystemDisplaySetDisplayPropertiesFunction::Response(
    std::optional<std::string> error) {}

ExtensionFunction::ResponseAction SystemDisplaySetDisplayLayoutFunction::Run() {}

void SystemDisplaySetDisplayLayoutFunction::Response(
    std::optional<std::string> error) {}

ExtensionFunction::ResponseAction
SystemDisplayEnableUnifiedDesktopFunction::Run() {}

ExtensionFunction::ResponseAction
SystemDisplayOverscanCalibrationStartFunction::Run() {}

ExtensionFunction::ResponseAction
SystemDisplayOverscanCalibrationAdjustFunction::Run() {}

ExtensionFunction::ResponseAction
SystemDisplayOverscanCalibrationResetFunction::Run() {}

ExtensionFunction::ResponseAction
SystemDisplayOverscanCalibrationCompleteFunction::Run() {}

ExtensionFunction::ResponseAction
SystemDisplayShowNativeTouchCalibrationFunction::Run() {}

void SystemDisplayShowNativeTouchCalibrationFunction::OnCalibrationComplete(
    std::optional<std::string> error) {}

ExtensionFunction::ResponseAction
SystemDisplayStartCustomTouchCalibrationFunction::Run() {}

ExtensionFunction::ResponseAction
SystemDisplayCompleteCustomTouchCalibrationFunction::Run() {}

ExtensionFunction::ResponseAction
SystemDisplayClearTouchCalibrationFunction::Run() {}

ExtensionFunction::ResponseAction SystemDisplaySetMirrorModeFunction::Run() {}

void SystemDisplaySetMirrorModeFunction::Response(
    std::optional<std::string> error) {}

}  // namespace extensions