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

@ -1172,15 +1172,6 @@ void NativeWindowMac::SetIgnoreMouseEvents(bool ignore, bool forward) {
}
}
void NativeWindowMac::SetContentProtection(bool enable) {
[window_
setSharingType:enable ? NSWindowSharingNone : NSWindowSharingReadOnly];
}
bool NativeWindowMac::IsContentProtected() const {
return [window_ sharingType] == NSWindowSharingNone;
}
void NativeWindowMac::SetFocusable(bool focusable) {
// No known way to unfocus the window if it had the focus. Here we do not
// want to call Focus(false) because it moves the window to the back, i.e.