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 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1847 @implementation BrowserWindowController(Fullscreen) | 1847 @implementation BrowserWindowController(Fullscreen) |
1848 | 1848 |
1849 - (void)handleLionToggleFullscreen { | 1849 - (void)handleLionToggleFullscreen { |
1850 chrome::ExecuteCommand(browser_.get(), IDC_FULLSCREEN); | 1850 chrome::ExecuteCommand(browser_.get(), IDC_FULLSCREEN); |
1851 } | 1851 } |
1852 | 1852 |
1853 - (void)enterBrowserFullscreen { | 1853 - (void)enterBrowserFullscreen { |
1854 [self enterAppKitFullscreen]; | 1854 [self enterAppKitFullscreen]; |
1855 } | 1855 } |
1856 | 1856 |
1857 - (void)updateFullscreenWithToolbar:(BOOL)withToolbar { | 1857 - (void)updateUIForTabFullscreen: |
1858 (ExclusiveAccessContext::TabFullscreenState)state { | |
1859 DCHECK([self isInAnyFullscreenMode]); | |
1860 if (state == ExclusiveAccessContext::STATE_ENTER_TAB_FULLSCREEN) { | |
1861 [self adjustUIForSlidingFullscreenStyle:fullscreen_mac::OMNIBOX_TABS_NONE]; | |
1862 return; | |
1863 } | |
1864 | |
1858 [self adjustUIForSlidingFullscreenStyle: | 1865 [self adjustUIForSlidingFullscreenStyle: |
1859 withToolbar ? fullscreen_mac::OMNIBOX_TABS_PRESENT | 1866 shouldShowFullscreenToolbar_ ? fullscreen_mac::OMNIBOX_TABS_PRESENT |
1860 : fullscreen_mac::OMNIBOX_TABS_HIDDEN]; | 1867 : fullscreen_mac::OMNIBOX_TABS_HIDDEN]; |
1861 } | 1868 } |
1862 | 1869 |
1863 - (void)updateFullscreenExitBubble { | 1870 - (void)updateFullscreenExitBubble { |
1864 [self layoutSubviews]; | 1871 [self layoutSubviews]; |
1865 [self showFullscreenExitBubbleIfNecessary]; | 1872 [self showFullscreenExitBubbleIfNecessary]; |
1866 } | 1873 } |
1867 | 1874 |
1868 - (BOOL)exitExtensionFullscreenIfPossible { | 1875 - (BOOL)exitExtensionFullscreenIfPossible { |
1869 if (browser_->exclusive_access_manager() | 1876 if (browser_->exclusive_access_manager() |
1870 ->fullscreen_controller() | 1877 ->fullscreen_controller() |
1871 ->IsExtensionFullscreenOrPending()) { | 1878 ->IsExtensionFullscreenOrPending()) { |
1872 browser_->extension_window_controller()->SetFullscreenMode(NO, GURL()); | 1879 browser_->extension_window_controller()->SetFullscreenMode(NO, GURL()); |
1873 return YES; | 1880 return YES; |
1874 } | 1881 } |
1875 return NO; | 1882 return NO; |
1876 } | 1883 } |
1877 | 1884 |
1878 - (void)setFullscreenToolbarVisible:(BOOL)visible { | 1885 - (void)setFullscreenToolbarVisible:(BOOL)visible { |
1879 if (shouldShowFullscreenToolbar_ == visible) | 1886 if (shouldShowFullscreenToolbar_ == visible) |
1880 return; | 1887 return; |
1881 | 1888 |
1882 [presentationModeController_ setToolbarFraction:0.0]; | 1889 [presentationModeController_ setToolbarFraction:0.0]; |
1883 shouldShowFullscreenToolbar_ = visible; | 1890 shouldShowFullscreenToolbar_ = visible; |
1884 if ([self isInAppKitFullscreen]) | 1891 [self adjustUIForSlidingFullscreenStyle: |
1885 [self updateFullscreenWithToolbar:shouldShowFullscreenToolbar_]; | 1892 shouldShowFullscreenToolbar_ ? fullscreen_mac::OMNIBOX_TABS_PRESENT |
1893 : fullscreen_mac::OMNIBOX_TABS_HIDDEN]; | |
Nico
2016/06/27 18:14:16
i can't quite follow the changes in this file
spqchan
2016/06/27 18:33:49
The changes in this file are less of a refactor, a
| |
1886 } | 1894 } |
1887 | 1895 |
1888 - (BOOL)isInAnyFullscreenMode { | 1896 - (BOOL)isInAnyFullscreenMode { |
1889 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen]; | 1897 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen]; |
1890 } | 1898 } |
1891 | 1899 |
1892 - (BOOL)isInImmersiveFullscreen { | 1900 - (BOOL)isInImmersiveFullscreen { |
1893 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_; | 1901 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_; |
1894 } | 1902 } |
1895 | 1903 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2024 | 2032 |
2025 - (NSRect)savedRegularWindowFrame { | 2033 - (NSRect)savedRegularWindowFrame { |
2026 return savedRegularWindowFrame_; | 2034 return savedRegularWindowFrame_; |
2027 } | 2035 } |
2028 | 2036 |
2029 - (BOOL)isFullscreenTransitionInProgress { | 2037 - (BOOL)isFullscreenTransitionInProgress { |
2030 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; | 2038 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; |
2031 } | 2039 } |
2032 | 2040 |
2033 @end // @implementation BrowserWindowController(WindowType) | 2041 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |