From d4413a8e53590b43d622ad9dce4259be89acbb8c Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 16 Feb 2024 17:31:34 +0100 Subject: [PATCH] chore: remove unused anonymous namespace methods (#41333) --- shell/browser/native_window_mac.mm | 42 ------------------------------ 1 file changed, 42 deletions(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 69ef9fc5ba55..240f69d0c635 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -118,52 +118,10 @@ namespace electron { namespace { -bool IsFramelessWindow(NSView* view) { - NSWindow* nswindow = [view window]; - if (![nswindow respondsToSelector:@selector(shell)]) - return false; - NativeWindow* window = [static_cast(nswindow) shell]; - return window && !window->has_frame(); -} - bool IsPanel(NSWindow* window) { return [window isKindOfClass:[NSPanel class]]; } -IMP original_set_frame_size = nullptr; -IMP original_view_did_move_to_superview = nullptr; - -// This method is directly called by NSWindow during a window resize on OSX -// 10.10.0, beta 2. We must override it to prevent the content view from -// shrinking. -void SetFrameSize(NSView* self, SEL _cmd, NSSize size) { - if (!IsFramelessWindow(self)) { - auto original = - reinterpret_cast(original_set_frame_size); - return original(self, _cmd, size); - } - // For frameless window, resize the view to cover full window. - if ([self superview]) - size = [[self superview] bounds].size; - auto super_impl = reinterpret_cast( - [[self superclass] instanceMethodForSelector:_cmd]); - super_impl(self, _cmd, size); -} - -// The contentView gets moved around during certain full-screen operations. -// This is less than ideal, and should eventually be removed. -void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { - if (!IsFramelessWindow(self)) { - // [BridgedContentView viewDidMoveToSuperview]; - auto original = reinterpret_cast( - original_view_did_move_to_superview); - if (original) - original(self, _cmd); - return; - } - [self setFrame:[[self superview] bounds]]; -} - // -[NSWindow orderWindow] does not handle reordering for children // windows. Their order is fixed to the attachment order (the last attached // window is on the top). Therefore, work around it by re-parenting in our