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 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2090 } else { | 2090 } else { |
2091 // Need to invoke AppKit Fullscreen API. Presentation mode will | 2091 // Need to invoke AppKit Fullscreen API. Presentation mode will |
2092 // automatically be enabled in |-windowWillEnterFullScreen:|. | 2092 // automatically be enabled in |-windowWillEnterFullScreen:|. |
2093 enteringPresentationMode_ = YES; | 2093 enteringPresentationMode_ = YES; |
2094 [self enterAppKitFullscreen]; | 2094 [self enterAppKitFullscreen]; |
2095 } | 2095 } |
2096 } | 2096 } |
2097 | 2097 |
2098 - (void)enterHTML5FullscreenForURL:(const GURL&)url | 2098 - (void)enterHTML5FullscreenForURL:(const GURL&)url |
2099 bubbleType:(FullscreenExitBubbleType)bubbleType { | 2099 bubbleType:(FullscreenExitBubbleType)bubbleType { |
2100 if (!chrome::mac::SupportsSystemFullscreen()) { | 2100 [self enterImmersiveFullscreen]; |
2101 [self enterImmersiveFullscreen]; | 2101 if (!url.is_empty()) |
2102 if (!url.is_empty()) | 2102 [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType]; |
2103 [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType]; | |
2104 } else { | |
2105 [self enterPresentationModeForURL:url bubbleType:bubbleType]; | |
2106 } | |
2107 } | 2103 } |
2108 | 2104 |
2109 - (void)exitAnyFullscreen { | 2105 - (void)exitAnyFullscreen { |
2110 // TODO(erikchen): Fullscreen modes should stack. Should be able to exit | 2106 // TODO(erikchen): Fullscreen modes should stack. Should be able to exit |
2111 // Immersive Fullscreen and still be in AppKit Fullscreen. | 2107 // Immersive Fullscreen and still be in AppKit Fullscreen. |
2112 if ([self isInAppKitFullscreen]) | 2108 if ([self isInAppKitFullscreen]) |
2113 [self exitAppKitFullscreen]; | 2109 [self exitAppKitFullscreen]; |
2114 if ([self isInImmersiveFullscreen]) | 2110 if ([self isInImmersiveFullscreen]) |
2115 [self exitImmersiveFullscreen]; | 2111 [self exitImmersiveFullscreen]; |
2116 } | 2112 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2196 | 2192 |
2197 - (BOOL)supportsBookmarkBar { | 2193 - (BOOL)supportsBookmarkBar { |
2198 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2194 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2199 } | 2195 } |
2200 | 2196 |
2201 - (BOOL)isTabbedWindow { | 2197 - (BOOL)isTabbedWindow { |
2202 return browser_->is_type_tabbed(); | 2198 return browser_->is_type_tabbed(); |
2203 } | 2199 } |
2204 | 2200 |
2205 @end // @implementation BrowserWindowController(WindowType) | 2201 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |