Index: chrome/browser/ui/fullscreen/fullscreen_controller.cc |
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller.cc b/chrome/browser/ui/fullscreen/fullscreen_controller.cc |
index 5f9ab4e8748d8a81aa95639eb3a024aebbba0f8e..d11b9422e6755d7479c9103d71810e84612dccb4 100644 |
--- a/chrome/browser/ui/fullscreen/fullscreen_controller.cc |
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller.cc |
@@ -83,9 +83,6 @@ void FullscreenController::ToggleFullscreenModeForTab(WebContents* web_contents, |
#endif |
bool in_browser_or_tab_fullscreen_mode = window_->IsFullscreen(); |
-#if defined(OS_MACOSX) |
- in_browser_or_tab_fullscreen_mode |= window_->InPresentationMode(); |
-#endif |
if (enter_fullscreen) { |
SetFullscreenedTab(web_contents); |
@@ -252,9 +249,7 @@ void FullscreenController::WindowFullscreenStateChanged() { |
reentrant_window_state_change_call_check_ = true; |
bool exiting_fullscreen = !window_->IsFullscreen(); |
-#if defined(OS_MACOSX) |
- exiting_fullscreen &= !window_->InPresentationMode(); |
-#endif |
+ |
PostFullscreenChangeNotification(!exiting_fullscreen); |
if (exiting_fullscreen) |
NotifyTabOfExitIfNecessary(); |
@@ -501,6 +496,12 @@ void FullscreenController::ToggleFullscreenModeInternal(bool for_tab) { |
#endif |
toggled_into_fullscreen_ = !window_->IsFullscreen(); |
+#if defined(OS_MACOSX) |
+ // When a Mac user requests a toggle they may be transitioning from |
+ // FullscreenWithoutChrome to FullscreenWithChrome. |
+ if (!IsFullscreenForTabOrPending()) |
+ toggled_into_fullscreen_ |= window_->IsFullscreenWithoutChrome(); |
+#endif |
// In kiosk mode, we always want to be fullscreen. When the browser first |
// starts we're not yet fullscreen, so let the initial toggle go through. |
@@ -519,19 +520,19 @@ void FullscreenController::ToggleFullscreenModeInternal(bool for_tab) { |
content::RecordAction(UserMetricsAction("ToggleFullscreen")); |
} |
if (toggled_into_fullscreen_) { |
+#if defined(OS_MACOSX) |
+ window_->EnterFullscreenWithChrome(url, GetFullscreenExitBubbleType()); |
Robert Sesek
2013/01/18 19:41:35
This should probably just be EnterFullscreen so th
scheib
2013/01/23 18:13:37
I'd like to keep it explicit here that we are goin
|
+#else |
window_->EnterFullscreen(url, GetFullscreenExitBubbleType()); |
+#endif |
} else { |
#if defined(OS_MACOSX) |
// Mac windows report a state change instantly, and so we must also clear |
// tab_caused_fullscreen_ to match them else other logic using |
// tab_caused_fullscreen_ will be incorrect. |
NotifyTabOfExitIfNecessary(); |
- |
- if (window_->InPresentationMode() && !for_tab) |
- window_->ExitPresentationMode(); |
- else |
#endif |
- window_->ExitFullscreen(); |
+ window_->ExitFullscreen(); |
extension_caused_fullscreen_ = GURL(); |
} |
UpdateFullscreenExitBubbleContent(); |
@@ -544,15 +545,15 @@ void FullscreenController::ToggleFullscreenModeInternal(bool for_tab) { |
#if defined(OS_MACOSX) |
void FullscreenController::TogglePresentationModeInternal(bool for_tab) { |
- toggled_into_fullscreen_ = !window_->InPresentationMode(); |
+ toggled_into_fullscreen_ = !window_->IsFullscreenWithoutChrome(); |
GURL url; |
if (for_tab) { |
url = chrome::GetActiveWebContents(browser_)->GetURL(); |
tab_fullscreen_accepted_ = toggled_into_fullscreen_ && |
GetFullscreenSetting(url) == CONTENT_SETTING_ALLOW; |
} |
- if (!window_->InPresentationMode()) { |
- window_->EnterPresentationMode(url, GetFullscreenExitBubbleType()); |
+ if (!window_->IsFullscreenWithoutChrome()) { |
+ window_->EnterFullscreen(url, GetFullscreenExitBubbleType()); |
} else { |
window_->ExitFullscreen(); |