summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/browser_window_controller.mm
diff options
context:
space:
mode:
authorspqchan <spqchan@chromium.org>2016-02-26 11:28:26 -0800
committerspqchan <spqchan@chromium.org>2016-02-26 19:31:12 +0000
commit64316afc6c638313d74d043fc73f6ba51b7f169b (patch)
treeb88e7001f1df67b379484d51daa2437121e7c8a9 /chrome/browser/ui/cocoa/browser_window_controller.mm
parentfd563254490ae93382cb88a1e9a1c1e54815c97b (diff)
downloadchromium_src-64316afc6c638313d74d043fc73f6ba51b7f169b.zip
chromium_src-64316afc6c638313d74d043fc73f6ba51b7f169b.tar.gz
chromium_src-64316afc6c638313d74d043fc73f6ba51b7f169b.tar.bz2
Revert to Immersive Fullscreen on OSX for a special case
If the user is using multiple monitors and turned off "Separate Space in Each Display", use Immersive Fullscreen so that the other monitors won't blank out. BUG=582944,580843 Review URL: https://codereview.chromium.org/1725643002 TBR=avi@chromium.org Cr-Commit-Position: refs/heads/master@{#377116} (cherry picked from commit d310f829e7f38f725a5b695ea701a3ffa3b3cf89) Review URL: https://codereview.chromium.org/1743663002 . Cr-Commit-Position: refs/branch-heads/2623@{#522} Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}
Diffstat (limited to 'chrome/browser/ui/cocoa/browser_window_controller.mm')
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 9c2e44c..f0b4e5b 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -100,6 +100,7 @@
#include "ui/base/l10n/l10n_util_mac.h"
#import "ui/gfx/mac/coordinate_conversion.h"
#include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h"
+#include "ui/gfx/screen.h"
using bookmarks::BookmarkModel;
using bookmarks::BookmarkNode;
@@ -2026,11 +2027,18 @@ willAnimateFromState:(BookmarkBar::State)oldState
- (void)enterWebContentFullscreenForURL:(const GURL&)url
bubbleType:(ExclusiveAccessBubbleType)bubbleType {
// HTML5 Fullscreen should only use AppKit fullscreen in 10.10+.
+ // However, if the user is using multiple monitors and turned off
+ // "Separate Space in Each Display", use Immersive Fullscreen so
+ // that the other monitors won't blank out.
+ gfx::Screen* screen = gfx::Screen::GetScreenFor([[self window] contentView]);
+ BOOL hasMultipleMonitors = screen && screen->GetNumDisplays() > 1;
if (chrome::mac::SupportsSystemFullscreen() &&
- base::mac::IsOSYosemiteOrLater())
+ base::mac::IsOSYosemiteOrLater() &&
+ !(hasMultipleMonitors && ![NSScreen screensHaveSeparateSpaces])) {
[self enterAppKitFullscreen];
- else
+ } else {
[self enterImmersiveFullscreen];
+ }
if (!url.is_empty())
[self updateFullscreenExitBubbleURL:url bubbleType:bubbleType];