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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 523723002: mac, fullscreen: Several bug fixes after major refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new_fullscreen2
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
2029 - (void)activatePageAction:(const std::string&)extension_id { 2029 - (void)activatePageAction:(const std::string&)extension_id {
2030 [toolbarController_ activatePageAction:extension_id]; 2030 [toolbarController_ activatePageAction:extension_id];
2031 } 2031 }
2032 2032
2033 - (void)activateBrowserAction:(const std::string&)extension_id { 2033 - (void)activateBrowserAction:(const std::string&)extension_id {
2034 [toolbarController_ activateBrowserAction:extension_id]; 2034 [toolbarController_ activateBrowserAction:extension_id];
2035 } 2035 }
2036 2036
2037 @end // @implementation BrowserWindowController 2037 @end // @implementation BrowserWindowController
2038 2038
2039
2040 @implementation BrowserWindowController(Fullscreen) 2039 @implementation BrowserWindowController(Fullscreen)
2041 2040
2042 - (void)handleLionToggleFullscreen { 2041 - (void)handleLionToggleFullscreen {
2043 DCHECK(base::mac::IsOSLionOrLater()); 2042 DCHECK(base::mac::IsOSLionOrLater());
2044 chrome::ExecuteCommand(browser_.get(), IDC_FULLSCREEN); 2043 chrome::ExecuteCommand(browser_.get(), IDC_FULLSCREEN);
2045 } 2044 }
2046 2045
2047 - (void)enterFullscreenWithChrome { 2046 - (void)enterFullscreenWithChrome {
2048 if (![self isInAppKitFullscreen]) { 2047 if (![self isInAppKitFullscreen]) {
2049 // Invoking the AppKitFullscreen API by default uses Canonical Fullscreen. 2048 // Invoking the AppKitFullscreen API by default uses Canonical Fullscreen.
(...skipping 23 matching lines...) Expand all
2073 } 2072 }
2074 2073
2075 - (BOOL)isInAppKitFullscreen { 2074 - (BOOL)isInAppKitFullscreen {
2076 return ([[self window] styleMask] & NSFullScreenWindowMask) == 2075 return ([[self window] styleMask] & NSFullScreenWindowMask) ==
2077 NSFullScreenWindowMask || 2076 NSFullScreenWindowMask ||
2078 enteringAppKitFullscreen_; 2077 enteringAppKitFullscreen_;
2079 } 2078 }
2080 2079
2081 - (BOOL)isInFullscreenWithOmniboxSliding { 2080 - (BOOL)isInFullscreenWithOmniboxSliding {
2082 return presentationModeController_.get() != nil; 2081 return presentationModeController_.get() != nil;
2083 //[presentationModeController_ inPresentationMode]);
2084 } 2082 }
2085 2083
2086 - (void)enterPresentationModeForURL:(const GURL&)url 2084 - (void)enterPresentationModeForURL:(const GURL&)url
2087 bubbleType:(FullscreenExitBubbleType)bubbleType { 2085 bubbleType:(FullscreenExitBubbleType)bubbleType {
2088 DCHECK(chrome::mac::SupportsSystemFullscreen()); 2086 DCHECK(chrome::mac::SupportsSystemFullscreen());
2089 fullscreenUrl_ = url; 2087 fullscreenUrl_ = url;
2090 fullscreenBubbleType_ = bubbleType; 2088 fullscreenBubbleType_ = bubbleType;
2091 2089
2092 if ([self isInAppKitFullscreen]) { 2090 if ([self isInAppKitFullscreen]) {
2093 // Already in AppKit Fullscreen. Adjust the UI to use Presentation Mode. 2091 // Already in AppKit Fullscreen. Adjust the UI to use Presentation Mode.
(...skipping 23 matching lines...) Expand all
2117 - (void)exitGenericFullscreen { 2115 - (void)exitGenericFullscreen {
2118 if ([self isInAppKitFullscreen]) 2116 if ([self isInAppKitFullscreen])
2119 [self exitAppKitFullscreen]; 2117 [self exitAppKitFullscreen];
2120 if ([self isInImmersiveFullscreen]) 2118 if ([self isInImmersiveFullscreen])
2121 [self exitImmersiveFullscreen]; 2119 [self exitImmersiveFullscreen];
2122 } 2120 }
2123 2121
2124 - (BOOL)inPresentationMode { 2122 - (BOOL)inPresentationMode {
2125 return presentationModeController_.get() && 2123 return presentationModeController_.get() &&
2126 [presentationModeController_ inPresentationMode] && 2124 [presentationModeController_ inPresentationMode] &&
2127 fullscreenStyle_ == fullscreen_mac::OMNIBOX_TABS_HIDDEN; 2125 presentationModeController_.get().slidingStyle ==
2126 fullscreen_mac::OMNIBOX_TABS_HIDDEN;
2128 } 2127 }
2129 2128
2130 - (void)resizeFullscreenWindow { 2129 - (void)resizeFullscreenWindow {
2131 DCHECK([self isInAnyFullscreenMode]); 2130 DCHECK([self isInAnyFullscreenMode]);
2132 if (![self isInAnyFullscreenMode]) 2131 if (![self isInAnyFullscreenMode])
2133 return; 2132 return;
2134 2133
2135 NSWindow* window = [self window]; 2134 NSWindow* window = [self window];
2136 [window setFrame:[[window screen] frame] display:YES]; 2135 [window setFrame:[[window screen] frame] display:YES];
2137 [self layoutSubviews]; 2136 [self layoutSubviews];
2138 } 2137 }
2139 2138
2140 - (CGFloat)floatingBarShownFraction {
2141 return floatingBarShownFraction_;
2142 }
2143
2144 - (void)setFloatingBarShownFraction:(CGFloat)fraction {
2145 floatingBarShownFraction_ = fraction;
2146 [self layoutSubviews];
2147 }
2148
2149 - (BOOL)isBarVisibilityLockedForOwner:(id)owner { 2139 - (BOOL)isBarVisibilityLockedForOwner:(id)owner {
2150 DCHECK(owner); 2140 DCHECK(owner);
2151 DCHECK(barVisibilityLocks_); 2141 DCHECK(barVisibilityLocks_);
2152 return [barVisibilityLocks_ containsObject:owner]; 2142 return [barVisibilityLocks_ containsObject:owner];
2153 } 2143 }
2154 2144
2155 - (void)lockBarVisibilityForOwner:(id)owner 2145 - (void)lockBarVisibilityForOwner:(id)owner
2156 withAnimation:(BOOL)animate 2146 withAnimation:(BOOL)animate
2157 delay:(BOOL)delay { 2147 delay:(BOOL)delay {
2158 if (![self isBarVisibilityLockedForOwner:owner]) { 2148 if (![self isBarVisibilityLockedForOwner:owner]) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 2200
2211 - (BOOL)supportsBookmarkBar { 2201 - (BOOL)supportsBookmarkBar {
2212 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2202 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2213 } 2203 }
2214 2204
2215 - (BOOL)isTabbedWindow { 2205 - (BOOL)isTabbedWindow {
2216 return browser_->is_type_tabbed(); 2206 return browser_->is_type_tabbed();
2217 } 2207 }
2218 2208
2219 @end // @implementation BrowserWindowController(WindowType) 2209 @end // @implementation BrowserWindowController(WindowType)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698