OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <numeric> | 8 #include <numeric> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 - (BOOL)exitExtensionFullscreenIfPossible { | 1892 - (BOOL)exitExtensionFullscreenIfPossible { |
1893 if (browser_->exclusive_access_manager() | 1893 if (browser_->exclusive_access_manager() |
1894 ->fullscreen_controller() | 1894 ->fullscreen_controller() |
1895 ->IsExtensionFullscreenOrPending()) { | 1895 ->IsExtensionFullscreenOrPending()) { |
1896 browser_->extension_window_controller()->SetFullscreenMode(NO, GURL()); | 1896 browser_->extension_window_controller()->SetFullscreenMode(NO, GURL()); |
1897 return YES; | 1897 return YES; |
1898 } | 1898 } |
1899 return NO; | 1899 return NO; |
1900 } | 1900 } |
1901 | 1901 |
1902 - (BOOL)isInAnyFullscreenMode { | |
1903 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen]; | |
1904 } | |
1905 | |
1906 - (BOOL)isInImmersiveFullscreen { | 1902 - (BOOL)isInImmersiveFullscreen { |
1907 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_; | 1903 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_; |
1908 } | 1904 } |
1909 | 1905 |
1910 - (BOOL)isInAppKitFullscreen { | 1906 - (BOOL)isInAppKitFullscreen { |
1911 return !exitingAppKitFullscreen_ && | 1907 return !exitingAppKitFullscreen_ && |
1912 (([[self window] styleMask] & NSFullScreenWindowMask) == | 1908 (([[self window] styleMask] & NSFullScreenWindowMask) == |
1913 NSFullScreenWindowMask || | 1909 NSFullScreenWindowMask || |
1914 enteringAppKitFullscreen_); | 1910 enteringAppKitFullscreen_); |
1915 } | 1911 } |
1916 | 1912 |
| 1913 - (BOOL)isInAnyFullscreenMode { |
| 1914 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen]; |
| 1915 } |
| 1916 |
1917 - (NSView*)avatarView { | 1917 - (NSView*)avatarView { |
1918 return [avatarButtonController_ view]; | 1918 return [avatarButtonController_ view]; |
1919 } | 1919 } |
1920 | 1920 |
1921 - (void)enterWebContentFullscreen { | 1921 - (void)enterWebContentFullscreen { |
1922 // HTML5 Fullscreen should only use AppKit fullscreen in 10.10+. | 1922 // HTML5 Fullscreen should only use AppKit fullscreen in 10.10+. |
1923 // However, if the user is using multiple monitors and turned off | 1923 // However, if the user is using multiple monitors and turned off |
1924 // "Separate Space in Each Display", use Immersive Fullscreen so | 1924 // "Separate Space in Each Display", use Immersive Fullscreen so |
1925 // that the other monitors won't blank out. | 1925 // that the other monitors won't blank out. |
1926 display::Screen* screen = display::Screen::GetScreen(); | 1926 display::Screen* screen = display::Screen::GetScreen(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2033 | 2033 |
2034 - (NSRect)savedRegularWindowFrame { | 2034 - (NSRect)savedRegularWindowFrame { |
2035 return savedRegularWindowFrame_; | 2035 return savedRegularWindowFrame_; |
2036 } | 2036 } |
2037 | 2037 |
2038 - (BOOL)isFullscreenTransitionInProgress { | 2038 - (BOOL)isFullscreenTransitionInProgress { |
2039 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; | 2039 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; |
2040 } | 2040 } |
2041 | 2041 |
2042 @end // @implementation BrowserWindowController(WindowType) | 2042 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |