mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
refactor: reduce use of NativeWidgetPrivate (#46942)
* refactor: do not use native_widget_private() in NativeWindowViews::SetContentProtection()
refactor: do not use native_widget_private() in NativeWindowViews::IsContentProtected()
* refactor: do not use native_widget_private() in NativeWindowViews::Show()
* chore: remove native_widget_private #include from native_window_views_win
Not needed since Feb 2025: 9199d5c6
This commit is contained in:
@@ -488,8 +488,7 @@ bool NativeWindowViews::IsFocused() const {
|
||||
}
|
||||
|
||||
void NativeWindowViews::Show() {
|
||||
if (is_modal() && NativeWindow::parent() &&
|
||||
!widget()->native_widget_private()->IsVisible())
|
||||
if (is_modal() && NativeWindow::parent() && !widget()->IsVisible())
|
||||
static_cast<NativeWindowViews*>(parent())->IncrementChildModals();
|
||||
|
||||
widget()->native_widget_private()->Show(GetRestoredState(), gfx::Rect());
|
||||
@@ -1287,15 +1286,15 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetContentProtection(bool enable) {
|
||||
void NativeWindowViews::SetContentProtection(const bool enable) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
widget()->native_widget_private()->SetAllowScreenshots(!enable);
|
||||
widget()->SetAllowScreenshots(!enable);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool NativeWindowViews::IsContentProtected() const {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
return !widget()->native_widget_private()->AreScreenshotsAllowed();
|
||||
return !widget()->AreScreenshotsAllowed();
|
||||
#else // Not implemented on Linux
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "ui/display/display.h"
|
||||
#include "ui/display/screen.h"
|
||||
#include "ui/gfx/geometry/resize_utils.h"
|
||||
#include "ui/views/widget/native_widget_private.h"
|
||||
|
||||
// Must be included after other Windows headers.
|
||||
#include <UIAutomationClient.h>
|
||||
|
||||
Reference in New Issue
Block a user