OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2050 [self showFullscreenExitBubbleIfNecessary]; | 2050 [self showFullscreenExitBubbleIfNecessary]; |
2051 } else { | 2051 } else { |
2052 // If not in fullscreen mode, trigger the Lion fullscreen mode machinery. | 2052 // If not in fullscreen mode, trigger the Lion fullscreen mode machinery. |
2053 // Presentation mode will automatically be enabled in | 2053 // Presentation mode will automatically be enabled in |
2054 // |-windowWillEnterFullScreen:|. | 2054 // |-windowWillEnterFullScreen:|. |
2055 NSWindow* window = [self window]; | 2055 NSWindow* window = [self window]; |
2056 if ([window isKindOfClass:[FramedBrowserWindow class]]) | 2056 if ([window isKindOfClass:[FramedBrowserWindow class]]) |
2057 [static_cast<FramedBrowserWindow*>(window) toggleSystemFullScreen]; | 2057 [static_cast<FramedBrowserWindow*>(window) toggleSystemFullScreen]; |
2058 } | 2058 } |
2059 } else { | 2059 } else { |
2060 // The user is currently in presentation mode and is now exiting it, which | 2060 // Exiting presentation mode does not exit system fullscreen; it merely |
2061 // also exits fullscreen using the Lion machinery. | 2061 // switches from presentation mode to normal fullscreen. |
2062 NSWindow* window = [self window]; | 2062 [self setPresentationModeInternal:NO forceDropdown:NO]; |
2063 if ([window isKindOfClass:[FramedBrowserWindow class]]) | |
2064 [static_cast<FramedBrowserWindow*>(window) toggleSystemFullScreen]; | |
2065 } | 2063 } |
2066 } | 2064 } |
2067 | 2065 |
2068 - (void)enterPresentationModeForURL:(const GURL&)url | 2066 - (void)enterPresentationModeForURL:(const GURL&)url |
2069 bubbleType:(FullscreenExitBubbleType)bubbleType { | 2067 bubbleType:(FullscreenExitBubbleType)bubbleType { |
2070 [self setPresentationMode:YES url:url bubbleType:bubbleType]; | 2068 [self setPresentationMode:YES url:url bubbleType:bubbleType]; |
2071 } | 2069 } |
2072 | 2070 |
2073 - (void)exitPresentationMode { | 2071 - (void)exitPresentationMode { |
2074 // url: and bubbleType: are ignored when leaving presentation mode. | 2072 // url: and bubbleType: are ignored when leaving presentation mode. |
2075 [self setPresentationMode:NO url:GURL() bubbleType:FEB_TYPE_NONE]; | 2073 [self setPresentationMode:NO url:GURL() bubbleType:FEB_TYPE_NONE]; |
2076 } | 2074 } |
2077 | 2075 |
2078 - (BOOL)inPresentationMode { | 2076 - (BOOL)inPresentationMode { |
2079 return presentationModeController_.get() && | 2077 return presentationModeController_.get() && |
2080 [presentationModeController_ inPresentationMode]; | 2078 [presentationModeController_ inPresentationMode]; |
2081 } | 2079 } |
2082 | 2080 |
2083 - (void)resizeFullscreenWindow { | 2081 - (void)resizeFullscreenWindow { |
2084 DCHECK([self isFullscreen]); | 2082 DCHECK([self isFullscreen]); |
2085 if (![self isFullscreen]) | 2083 if (![self isFullscreen]) |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 | 2202 |
2205 - (BOOL)supportsBookmarkBar { | 2203 - (BOOL)supportsBookmarkBar { |
2206 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2204 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2207 } | 2205 } |
2208 | 2206 |
2209 - (BOOL)isTabbedWindow { | 2207 - (BOOL)isTabbedWindow { |
2210 return browser_->is_type_tabbed(); | 2208 return browser_->is_type_tabbed(); |
2211 } | 2209 } |
2212 | 2210 |
2213 @end // @implementation BrowserWindowController(WindowType) | 2211 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |