| 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 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 @implementation BrowserWindowController(Fullscreen) | 1863 @implementation BrowserWindowController(Fullscreen) |
| 1864 | 1864 |
| 1865 - (void)enterBrowserFullscreen { | 1865 - (void)enterBrowserFullscreen { |
| 1866 [self enterAppKitFullscreen]; | 1866 [self enterAppKitFullscreen]; |
| 1867 } | 1867 } |
| 1868 | 1868 |
| 1869 - (void)updateUIForTabFullscreen: | 1869 - (void)updateUIForTabFullscreen: |
| 1870 (ExclusiveAccessContext::TabFullscreenState)state { | 1870 (ExclusiveAccessContext::TabFullscreenState)state { |
| 1871 DCHECK([self isInAnyFullscreenMode]); | 1871 DCHECK([self isInAnyFullscreenMode]); |
| 1872 if (state == ExclusiveAccessContext::STATE_ENTER_TAB_FULLSCREEN) { | 1872 if (state == ExclusiveAccessContext::STATE_ENTER_TAB_FULLSCREEN) { |
| 1873 [self adjustUIForSlidingFullscreenStyle:fullscreen_mac::OMNIBOX_TABS_NONE]; | 1873 [self adjustUIForSlidingFullscreenStyle:FullscreenSlidingStyle:: |
| 1874 OMNIBOX_TABS_NONE]; |
| 1874 return; | 1875 return; |
| 1875 } | 1876 } |
| 1876 | 1877 |
| 1877 [self adjustUIForSlidingFullscreenStyle: | 1878 [self adjustUIForSlidingFullscreenStyle: |
| 1878 shouldShowFullscreenToolbar_ ? fullscreen_mac::OMNIBOX_TABS_PRESENT | 1879 shouldShowFullscreenToolbar_ |
| 1879 : fullscreen_mac::OMNIBOX_TABS_HIDDEN]; | 1880 ? FullscreenSlidingStyle::OMNIBOX_TABS_PRESENT |
| 1881 : FullscreenSlidingStyle::OMNIBOX_TABS_HIDDEN]; |
| 1880 } | 1882 } |
| 1881 | 1883 |
| 1882 - (void)updateFullscreenExitBubble { | 1884 - (void)updateFullscreenExitBubble { |
| 1883 [self layoutSubviews]; | 1885 [self layoutSubviews]; |
| 1884 [self showFullscreenExitBubbleIfNecessary]; | 1886 [self showFullscreenExitBubbleIfNecessary]; |
| 1885 } | 1887 } |
| 1886 | 1888 |
| 1887 - (BOOL)exitExtensionFullscreenIfPossible { | 1889 - (BOOL)exitExtensionFullscreenIfPossible { |
| 1888 if (browser_->exclusive_access_manager() | 1890 if (browser_->exclusive_access_manager() |
| 1889 ->fullscreen_controller() | 1891 ->fullscreen_controller() |
| 1890 ->IsExtensionFullscreenOrPending()) { | 1892 ->IsExtensionFullscreenOrPending()) { |
| 1891 browser_->extension_window_controller()->SetFullscreenMode(NO, GURL()); | 1893 browser_->extension_window_controller()->SetFullscreenMode(NO, GURL()); |
| 1892 return YES; | 1894 return YES; |
| 1893 } | 1895 } |
| 1894 return NO; | 1896 return NO; |
| 1895 } | 1897 } |
| 1896 | 1898 |
| 1897 - (void)setFullscreenToolbarVisible:(BOOL)visible { | 1899 - (void)setFullscreenToolbarVisible:(BOOL)visible { |
| 1898 if (shouldShowFullscreenToolbar_ == visible) | 1900 if (shouldShowFullscreenToolbar_ == visible) |
| 1899 return; | 1901 return; |
| 1900 | 1902 |
| 1901 shouldShowFullscreenToolbar_ = visible; | 1903 shouldShowFullscreenToolbar_ = visible; |
| 1902 [self adjustUIForSlidingFullscreenStyle: | 1904 [self adjustUIForSlidingFullscreenStyle: |
| 1903 shouldShowFullscreenToolbar_ ? fullscreen_mac::OMNIBOX_TABS_PRESENT | 1905 shouldShowFullscreenToolbar_ |
| 1904 : fullscreen_mac::OMNIBOX_TABS_HIDDEN]; | 1906 ? FullscreenSlidingStyle::OMNIBOX_TABS_PRESENT |
| 1907 : FullscreenSlidingStyle::OMNIBOX_TABS_HIDDEN]; |
| 1905 } | 1908 } |
| 1906 | 1909 |
| 1907 - (BOOL)isInAnyFullscreenMode { | 1910 - (BOOL)isInAnyFullscreenMode { |
| 1908 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen]; | 1911 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen]; |
| 1909 } | 1912 } |
| 1910 | 1913 |
| 1911 - (BOOL)isInImmersiveFullscreen { | 1914 - (BOOL)isInImmersiveFullscreen { |
| 1912 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_; | 1915 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_; |
| 1913 } | 1916 } |
| 1914 | 1917 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1977 : [barVisibilityLocks_ count]; | 1980 : [barVisibilityLocks_ count]; |
| 1978 } | 1981 } |
| 1979 | 1982 |
| 1980 - (void)lockBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate { | 1983 - (void)lockBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate { |
| 1981 if (![self isBarVisibilityLockedForOwner:owner]) { | 1984 if (![self isBarVisibilityLockedForOwner:owner]) { |
| 1982 [barVisibilityLocks_ addObject:owner]; | 1985 [barVisibilityLocks_ addObject:owner]; |
| 1983 | 1986 |
| 1984 // If enabled, show the overlay if necessary (and if the fullscreen | 1987 // If enabled, show the overlay if necessary (and if the fullscreen |
| 1985 // toolbar is hidden). | 1988 // toolbar is hidden). |
| 1986 if (barVisibilityUpdatesEnabled_) { | 1989 if (barVisibilityUpdatesEnabled_) { |
| 1987 [fullscreenToolbarController_ ensureOverlayShownWithAnimation:animate]; | 1990 [fullscreenToolbarController_ lockBarVisibilityWithAnimation:animate]; |
| 1988 } | 1991 } |
| 1989 } | 1992 } |
| 1990 } | 1993 } |
| 1991 | 1994 |
| 1992 - (void)releaseBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate { | 1995 - (void)releaseBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate { |
| 1993 if ([self isBarVisibilityLockedForOwner:owner]) { | 1996 if ([self isBarVisibilityLockedForOwner:owner]) { |
| 1994 [barVisibilityLocks_ removeObject:owner]; | 1997 [barVisibilityLocks_ removeObject:owner]; |
| 1995 | 1998 |
| 1996 // If enabled, hide the overlay if necessary (and if the fullscreen | 1999 // If enabled, hide the overlay if necessary (and if the fullscreen |
| 1997 // toolbar is hidden). | 2000 // toolbar is hidden). |
| 1998 if (barVisibilityUpdatesEnabled_ && | 2001 if (barVisibilityUpdatesEnabled_ && |
| 1999 ![barVisibilityLocks_ count]) { | 2002 ![barVisibilityLocks_ count]) { |
| 2000 [fullscreenToolbarController_ ensureOverlayHiddenWithAnimation:animate]; | 2003 [fullscreenToolbarController_ releaseBarVisibilityWithAnimation:animate]; |
| 2001 } | 2004 } |
| 2002 } | 2005 } |
| 2003 } | 2006 } |
| 2004 | 2007 |
| 2005 - (BOOL)floatingBarHasFocus { | 2008 - (BOOL)floatingBarHasFocus { |
| 2006 NSResponder* focused = [[self window] firstResponder]; | 2009 NSResponder* focused = [[self window] firstResponder]; |
| 2007 return [focused isKindOfClass:[AutocompleteTextFieldEditor class]]; | 2010 return [focused isKindOfClass:[AutocompleteTextFieldEditor class]]; |
| 2008 } | 2011 } |
| 2009 | 2012 |
| 2010 - (ExclusiveAccessController*)exclusiveAccessController { | 2013 - (ExclusiveAccessController*)exclusiveAccessController { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2043 | 2046 |
| 2044 - (NSRect)savedRegularWindowFrame { | 2047 - (NSRect)savedRegularWindowFrame { |
| 2045 return savedRegularWindowFrame_; | 2048 return savedRegularWindowFrame_; |
| 2046 } | 2049 } |
| 2047 | 2050 |
| 2048 - (BOOL)isFullscreenTransitionInProgress { | 2051 - (BOOL)isFullscreenTransitionInProgress { |
| 2049 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; | 2052 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; |
| 2050 } | 2053 } |
| 2051 | 2054 |
| 2052 @end // @implementation BrowserWindowController(WindowType) | 2055 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |