Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2985)

Unified Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 12018007: Refactor BrowserWindow fullscreen and presentation on Mac to be consistent with other platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge TOT Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 0f68dab4a7a65bc3264ef8a76a2d65786443a2bc..df4ebade807ba85197f515531684a2647656005a 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -336,8 +336,8 @@ void BrowserWindowCocoa::Restore() {
void BrowserWindowCocoa::EnterFullscreen(
const GURL& url, FullscreenExitBubbleType bubble_type) {
- [controller_ enterFullscreenForURL:url
- bubbleType:bubble_type];
+ [controller_ enterPresentationModeForURL:url
Robert Sesek 2013/01/18 19:41:35 Why is this switching to enterPresentationMode? Sh
scheib 2013/01/18 22:12:33 The goal is that 'EnterFullscreen' goes to a fulls
Robert Sesek 2013/01/18 22:19:12 Got it and SGTM. This may need a change in Browse
+ bubbleType:bubble_type];
}
void BrowserWindowCocoa::ExitFullscreen() {
@@ -351,6 +351,8 @@ void BrowserWindowCocoa::UpdateFullscreenExitBubbleContent(
}
bool BrowserWindowCocoa::IsFullscreen() const {
+ if ([controller_ inPresentationMode])
+ CHECK([controller_ isFullscreen]); // Presentation mode must be fullscreen.
return [controller_ isFullscreen];
}
@@ -591,19 +593,22 @@ void BrowserWindowCocoa::OpenTabpose() {
[controller_ openTabpose];
}
-void BrowserWindowCocoa::EnterPresentationMode(
+void BrowserWindowCocoa::EnterFullscreenWithChrome(
const GURL& url,
Robert Sesek 2013/01/18 19:41:35 Can this URL ever be non-empty? I don't think a we
scheib 2013/01/23 18:13:37 Done.
FullscreenExitBubbleType bubble_type) {
- [controller_ enterPresentationModeForURL:url
- bubbleType:bubble_type];
+ if ([controller_ inPresentationMode])
+ [controller_ exitPresentationMode];
+ else
+ [controller_ enterFullscreenForURL:url
+ bubbleType:bubble_type];
}
-void BrowserWindowCocoa::ExitPresentationMode() {
- [controller_ exitPresentationMode];
+bool BrowserWindowCocoa::IsFullscreenWithChrome() {
+ return IsFullscreen() && ![controller_ inPresentationMode];
}
-bool BrowserWindowCocoa::InPresentationMode() {
- return [controller_ inPresentationMode];
+bool BrowserWindowCocoa::IsFullscreenWithoutChrome() {
+ return IsFullscreen() && [controller_ inPresentationMode];
}
gfx::Rect BrowserWindowCocoa::GetInstantBounds() {

Powered by Google App Engine
This is Rietveld 408576698