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 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2025 command:(const extensions::Command&)command { | 2025 command:(const extensions::Command&)command { |
2026 // Global commands are handled by the ExtensionCommandsGlobalRegistry | 2026 // Global commands are handled by the ExtensionCommandsGlobalRegistry |
2027 // instance. | 2027 // instance. |
2028 DCHECK(!command.global()); | 2028 DCHECK(!command.global()); |
2029 extension_keybinding_registry_->ExecuteCommand(extension_id, | 2029 extension_keybinding_registry_->ExecuteCommand(extension_id, |
2030 command.accelerator()); | 2030 command.accelerator()); |
2031 } | 2031 } |
2032 | 2032 |
2033 @end // @implementation BrowserWindowController | 2033 @end // @implementation BrowserWindowController |
2034 | 2034 |
2035 | |
2036 @implementation BrowserWindowController(Fullscreen) | 2035 @implementation BrowserWindowController(Fullscreen) |
2037 | 2036 |
2038 - (void)handleLionToggleFullscreen { | 2037 - (void)handleLionToggleFullscreen { |
2039 DCHECK(base::mac::IsOSLionOrLater()); | 2038 DCHECK(base::mac::IsOSLionOrLater()); |
2040 chrome::ExecuteCommand(browser_.get(), IDC_FULLSCREEN); | 2039 chrome::ExecuteCommand(browser_.get(), IDC_FULLSCREEN); |
2041 } | 2040 } |
2042 | 2041 |
2043 - (void)enterFullscreenWithChrome { | 2042 - (void)enterFullscreenWithChrome { |
2044 if (![self isInAppKitFullscreen]) { | 2043 if (![self isInAppKitFullscreen]) { |
2045 // Invoking the AppKitFullscreen API by default uses Canonical Fullscreen. | 2044 // Invoking the AppKitFullscreen API by default uses Canonical Fullscreen. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2114 // Immersive Fullscreen and still be in AppKit Fullscreen. | 2113 // Immersive Fullscreen and still be in AppKit Fullscreen. |
2115 if ([self isInAppKitFullscreen]) | 2114 if ([self isInAppKitFullscreen]) |
2116 [self exitAppKitFullscreen]; | 2115 [self exitAppKitFullscreen]; |
2117 if ([self isInImmersiveFullscreen]) | 2116 if ([self isInImmersiveFullscreen]) |
2118 [self exitImmersiveFullscreen]; | 2117 [self exitImmersiveFullscreen]; |
2119 } | 2118 } |
2120 | 2119 |
2121 - (BOOL)inPresentationMode { | 2120 - (BOOL)inPresentationMode { |
2122 return presentationModeController_.get() && | 2121 return presentationModeController_.get() && |
2123 [presentationModeController_ inPresentationMode] && | 2122 [presentationModeController_ inPresentationMode] && |
2124 fullscreenStyle_ == fullscreen_mac::OMNIBOX_TABS_HIDDEN; | 2123 presentationModeController_.get().slidingStyle == |
| 2124 fullscreen_mac::OMNIBOX_TABS_HIDDEN; |
2125 } | 2125 } |
2126 | 2126 |
2127 - (void)resizeFullscreenWindow { | 2127 - (void)resizeFullscreenWindow { |
2128 DCHECK([self isInAnyFullscreenMode]); | 2128 DCHECK([self isInAnyFullscreenMode]); |
2129 if (![self isInAnyFullscreenMode]) | 2129 if (![self isInAnyFullscreenMode]) |
2130 return; | 2130 return; |
2131 | 2131 |
2132 NSWindow* window = [self window]; | 2132 NSWindow* window = [self window]; |
2133 [window setFrame:[[window screen] frame] display:YES]; | 2133 [window setFrame:[[window screen] frame] display:YES]; |
2134 [self layoutSubviews]; | 2134 [self layoutSubviews]; |
2135 } | 2135 } |
2136 | 2136 |
2137 - (CGFloat)floatingBarShownFraction { | |
2138 return floatingBarShownFraction_; | |
2139 } | |
2140 | |
2141 - (void)setFloatingBarShownFraction:(CGFloat)fraction { | |
2142 floatingBarShownFraction_ = fraction; | |
2143 [self layoutSubviews]; | |
2144 } | |
2145 | |
2146 - (BOOL)isBarVisibilityLockedForOwner:(id)owner { | 2137 - (BOOL)isBarVisibilityLockedForOwner:(id)owner { |
2147 DCHECK(owner); | 2138 DCHECK(owner); |
2148 DCHECK(barVisibilityLocks_); | 2139 DCHECK(barVisibilityLocks_); |
2149 return [barVisibilityLocks_ containsObject:owner]; | 2140 return [barVisibilityLocks_ containsObject:owner]; |
2150 } | 2141 } |
2151 | 2142 |
2152 - (void)lockBarVisibilityForOwner:(id)owner | 2143 - (void)lockBarVisibilityForOwner:(id)owner |
2153 withAnimation:(BOOL)animate | 2144 withAnimation:(BOOL)animate |
2154 delay:(BOOL)delay { | 2145 delay:(BOOL)delay { |
2155 if (![self isBarVisibilityLockedForOwner:owner]) { | 2146 if (![self isBarVisibilityLockedForOwner:owner]) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2207 | 2198 |
2208 - (BOOL)supportsBookmarkBar { | 2199 - (BOOL)supportsBookmarkBar { |
2209 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2200 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2210 } | 2201 } |
2211 | 2202 |
2212 - (BOOL)isTabbedWindow { | 2203 - (BOOL)isTabbedWindow { |
2213 return browser_->is_type_tabbed(); | 2204 return browser_->is_type_tabbed(); |
2214 } | 2205 } |
2215 | 2206 |
2216 @end // @implementation BrowserWindowController(WindowType) | 2207 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |