From a567ba08ea1132098677d1c6ae1d3357692412d8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 11 Sep 2013 13:05:08 +0800 Subject: [PATCH] Hide the fullscreen button when leaving fullscreen mode. Fixes #88. --- browser/native_window.h | 2 ++ browser/native_window_mac.mm | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/browser/native_window.h b/browser/native_window.h index 8fb0f118fddf..3316b07053cf 100644 --- a/browser/native_window.h +++ b/browser/native_window.h @@ -115,6 +115,8 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, observers_.RemoveObserver(obs); } + bool has_frame() const { return has_frame_; } + protected: explicit NativeWindow(content::WebContents* web_contents, base::DictionaryValue* options); diff --git a/browser/native_window_mac.mm b/browser/native_window_mac.mm index d6858a191bb0..4994fad65fc2 100644 --- a/browser/native_window_mac.mm +++ b/browser/native_window_mac.mm @@ -67,6 +67,13 @@ return NO; } +- (void)windowDidExitFullScreen:(NSNotification*)notification { + if (!shell_->has_frame()) { + NSWindow* window = shell_->GetNativeWindow(); + [[window standardWindowButton:NSWindowFullScreenButton] setHidden:YES]; + } +} + @end @interface AtomNSWindow : AtomEventProcessingWindow {