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:
parent
3d4a4b9343
commit
1687b95849
6 changed files with 30 additions and 17 deletions
|
@ -44,6 +44,7 @@
|
|||
#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"
|
||||
|
@ -1324,6 +1325,20 @@ 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue