Rename SemaphoreView to CustomWindowButtonView

This commit is contained in:
Birunthan Mohanathas 2017-06-07 01:18:22 +03:00
parent d40a7569cc
commit 3106478510

View file

@ -46,15 +46,15 @@ bool ScopedDisableResize::disable_resize_ = false;
} // namespace } // namespace
// This view encapsuates the Quit, Minimize and Full Screen buttons. It is being // Custom Quit, Minimize and Full Screen button container for frameless
// used for frameless windows. // windows.
@interface SemaphoreView : NSView { @interface CustomWindowButtonView : NSView {
@private @private
BOOL mouse_inside_; BOOL mouse_inside_;
} }
@end @end
@implementation SemaphoreView @implementation CustomWindowButtonView
- (id)initWithFrame:(NSRect)frame { - (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
@ -1691,13 +1691,15 @@ void NativeWindowMac::InstallView() {
[[window_ standardWindowButton:NSWindowFullScreenButton] setHidden:YES]; [[window_ standardWindowButton:NSWindowFullScreenButton] setHidden:YES];
if (title_bar_style_ == CUSTOM_BUTTONS_ON_HOVER) { if (title_bar_style_ == CUSTOM_BUTTONS_ON_HOVER) {
NSView* buttons = NSView* window_button_view = [[[CustomWindowButtonView alloc]
[[[SemaphoreView alloc] initWithFrame:NSZeroRect] autorelease]; initWithFrame:NSZeroRect] autorelease];
buttons.frame = CGRectMake(0, window_button_view.frame =
[content_view_ bounds].size.height - buttons.frame.size.height, CGRectMake(0,
buttons.frame.size.width, [content_view_ bounds].size.height -
buttons.frame.size.height); window_button_view.frame.size.height,
[content_view_ addSubview:buttons]; window_button_view.frame.size.width,
window_button_view.frame.size.height);
[content_view_ addSubview:window_button_view];
} else { } else {
if (title_bar_style_ != NORMAL) { if (title_bar_style_ != NORMAL) {
if (base::mac::IsOS10_9()) { if (base::mac::IsOS10_9()) {