fix: revert macOS content protection logic refactor (#46890)

Revert "refactor: use upstream content protection logic on macOS (#46813)"

This reverts commit 34adb976b6.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
trop[bot] 2025-05-01 14:57:32 -07:00 committed by GitHub
parent 3d4a4b9343
commit 1687b95849
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 30 additions and 17 deletions

View file

@ -26,7 +26,6 @@
#include "shell/common/options_switches.h"
#include "ui/base/hit_test.h"
#include "ui/compositor/compositor.h"
#include "ui/views/widget/native_widget_private.h"
#include "ui/views/widget/widget.h"
#if !BUILDFLAG(IS_MAC)
@ -819,20 +818,6 @@ void NativeWindow::HandlePendingFullscreenTransitions() {
SetFullScreen(next_transition);
}
void NativeWindow::SetContentProtection(bool enable) {
#if !BUILDFLAG(IS_LINUX)
widget()->native_widget_private()->SetAllowScreenshots(!enable);
#endif
}
bool NativeWindow::IsContentProtected() const {
#if !BUILDFLAG(IS_LINUX)
return !widget()->native_widget_private()->AreScreenshotsAllowed();
#else // Not implemented on Linux
return false;
#endif
}
bool NativeWindow::IsTranslucent() const {
// Transparent windows are translucent
if (transparent()) {