Skip to content

Commit

Permalink
chore: GetStyleMask -> HasStyleMask
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed May 31, 2022
1 parent 45f2584 commit 4b491a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion shell/browser/native_window_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class NativeWindowMac : public NativeWindow,
void UpdateVibrancyRadii(bool fullscreen);

// Set the attribute of NSWindow while work around a bug of zoom button.
bool GetStyleMask(NSUInteger flag) const;
bool HasStyleMask(NSUInteger flag) const;
void SetStyleMask(bool on, NSUInteger flag);
void SetCollectionBehavior(bool on, NSUInteger flag);
void SetWindowLevel(int level);
Expand Down
14 changes: 7 additions & 7 deletions shell/browser/native_window_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
}

bool NativeWindowMac::IsMaximized() {
if (GetStyleMask(NSWindowStyleMaskResizable) != 0)
if (HasStyleMask(NSWindowStyleMaskResizable) != 0)
return [window_ isZoomed];

NSRect rectScreen = GetAspectRatio() > 0.0
Expand Down Expand Up @@ -715,7 +715,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
}

bool NativeWindowMac::IsFullscreen() const {
return GetStyleMask(NSWindowStyleMaskFullScreen);
return HasStyleMask(NSWindowStyleMaskFullScreen);
}

void NativeWindowMac::SetBounds(const gfx::Rect& bounds, bool animate) {
Expand Down Expand Up @@ -817,7 +817,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
bool NativeWindowMac::IsResizable() {
bool in_fs_transition =
fullscreen_transition_state() != FullScreenTransitionState::NONE;
bool has_rs_mask = GetStyleMask(NSWindowStyleMaskResizable);
bool has_rs_mask = HasStyleMask(NSWindowStyleMaskResizable);
return has_rs_mask && !IsFullscreen() && !in_fs_transition;
}

Expand All @@ -834,7 +834,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
}

bool NativeWindowMac::IsMinimizable() {
return GetStyleMask(NSMiniaturizableWindowMask);
return HasStyleMask(NSMiniaturizableWindowMask);
}

void NativeWindowMac::SetMaximizable(bool maximizable) {
Expand Down Expand Up @@ -864,7 +864,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
}

bool NativeWindowMac::IsClosable() {
return GetStyleMask(NSWindowStyleMaskClosable);
return HasStyleMask(NSWindowStyleMaskClosable);
}

void NativeWindowMac::SetAlwaysOnTop(ui::ZOrderLevel z_order,
Expand Down Expand Up @@ -1377,7 +1377,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
NSVisualEffectView* vibrantView = [window_ vibrantView];

if (vibrantView != nil && !vibrancy_type_.empty()) {
const bool no_rounded_corner = !GetStyleMask(NSWindowStyleMaskTitled);
const bool no_rounded_corner = !HasStyleMask(NSWindowStyleMaskTitled);
if (!has_frame() && !is_modal() && !no_rounded_corner) {
CGFloat radius;
if (fullscreen) {
Expand Down Expand Up @@ -1745,7 +1745,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
AddContentViewLayers();
}

bool NativeWindowMac::GetStyleMask(NSUInteger flag) const {
bool NativeWindowMac::HasStyleMask(NSUInteger flag) const {
return [window_ styleMask] & flag;
}

Expand Down
2 changes: 1 addition & 1 deletion shell/browser/ui/cocoa/electron_ns_window_delegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ - (void)windowDidEndLiveResize:(NSNotification*)notification {

- (void)windowWillEnterFullScreen:(NSNotification*)notification {
// Store resizable mask so it can be restored after exiting fullscreen.
is_resizable_ = shell_->GetStyleMask(NSResizableWindowMask);
is_resizable_ = shell_->HasStyleMask(NSResizableWindowMask);

shell_->SetFullScreenTransitionState(FullScreenTransitionState::ENTERING);

Expand Down

0 comments on commit 4b491a5

Please sign in to comment.