refactor: use upstream content protection logic on macOS (#46780)

* refactor: use upstream content protection logic on macOS

* Update shell/browser/native_window.h

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
Shelley Vohr 2025-04-26 18:31:30 +02:00 committed by GitHub
parent c2ab63f6d7
commit b03c71213e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 17 additions and 30 deletions

View file

@ -44,7 +44,6 @@
#include "ui/ozone/public/ozone_platform.h"
#include "ui/views/background.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/widget/native_widget_private.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/client_view.h"
#include "ui/wm/core/shadow_types.h"
@ -1314,20 +1313,6 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
#endif
}
void NativeWindowViews::SetContentProtection(bool enable) {
#if BUILDFLAG(IS_WIN)
widget()->native_widget_private()->SetAllowScreenshots(!enable);
#endif
}
bool NativeWindowViews::IsContentProtected() const {
#if BUILDFLAG(IS_WIN)
return !widget()->native_widget_private()->AreScreenshotsAllowed();
#else // Not implemented on Linux
return false;
#endif
}
void NativeWindowViews::SetFocusable(bool focusable) {
widget()->widget_delegate()->SetCanActivate(focusable);
#if BUILDFLAG(IS_WIN)