From 46b6bcd99b4a44cd0be3260324f62a12e9e56f0d Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Wed, 21 Aug 2019 18:16:43 -0400 Subject: [PATCH] chore: Update comment for desktop_capturer (#19848) * chore: Update comment for desktop_capturer * Guard TopLevelWindow::MoveAbove with ENABLE_DESKTOP_CAPTURER * Fix lint errors --- BUILD.gn | 3 +++ shell/browser/api/atom_api_top_level_window.cc | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 90bd0ff2d1e8..5265ca2ddfa6 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -583,6 +583,9 @@ source_set("electron_lib") { if (enable_desktop_capturer) { if (is_component_build && !is_linux) { + # On windows the implementation relies on unexported + # DxgiDuplicatorController class. On macOS the implementation + # relies on unexported webrtc::GetWindowOwnerPid method. deps += [ "//third_party/webrtc/modules/desktop_capture" ] } sources += [ diff --git a/shell/browser/api/atom_api_top_level_window.cc b/shell/browser/api/atom_api_top_level_window.cc index 39004cadeecd..fae177162085 100644 --- a/shell/browser/api/atom_api_top_level_window.cc +++ b/shell/browser/api/atom_api_top_level_window.cc @@ -555,8 +555,12 @@ std::vector TopLevelWindow::GetPosition() { } void TopLevelWindow::MoveAbove(const std::string& sourceId, mate::Arguments* args) { +#if BUILDFLAG(ENABLE_DESKTOP_CAPTURER) if (!window_->MoveAbove(sourceId)) args->ThrowError("Invalid media source id"); +#else + args->ThrowError("enable_desktop_capturer=true to use this feature"); +#endif } void TopLevelWindow::MoveTop() {