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

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 9ea43b82345bb640422aa78a741f7840f707667b..2099c1e83d66cb0ea0febd721429a5f0dbc6fa60 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -339,8 +339,8 @@ void BrowserWindowCocoa::Restore() {
void BrowserWindowCocoa::EnterFullscreen(
const GURL& url, FullscreenExitBubbleType bubble_type) {
- [controller_ enterFullscreenForURL:url
- bubbleType:bubble_type];
+ [controller_ enterPresentationModeForURL:url
+ bubbleType:bubble_type];
}
void BrowserWindowCocoa::ExitFullscreen() {
@@ -354,6 +354,8 @@ void BrowserWindowCocoa::UpdateFullscreenExitBubbleContent(
}
bool BrowserWindowCocoa::IsFullscreen() const {
+ if ([controller_ inPresentationMode])
+ CHECK([controller_ isFullscreen]); // Presentation mode must be fullscreen.
return [controller_ isFullscreen];
}
@@ -586,19 +588,20 @@ void BrowserWindowCocoa::OpenTabpose() {
[controller_ openTabpose];
}
-void BrowserWindowCocoa::EnterPresentationMode(
- const GURL& url,
- FullscreenExitBubbleType bubble_type) {
- [controller_ enterPresentationModeForURL:url
- bubbleType:bubble_type];
+void BrowserWindowCocoa::EnterFullscreenWithChrome() {
+ CHECK(base::mac::IsOSLionOrLater());
+ if ([controller_ inPresentationMode])
+ [controller_ exitPresentationMode];
+ else
+ [controller_ enterFullscreen];
}
-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() {
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.h ('k') | chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698