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 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1975 | 1975 |
1976 - (void)exitFullscreen { | 1976 - (void)exitFullscreen { |
1977 // url: and bubbleType: are ignored when leaving fullscreen. | 1977 // url: and bubbleType: are ignored when leaving fullscreen. |
1978 [self setFullscreen:NO url:GURL() bubbleType:FEB_TYPE_NONE]; | 1978 [self setFullscreen:NO url:GURL() bubbleType:FEB_TYPE_NONE]; |
1979 } | 1979 } |
1980 | 1980 |
1981 - (void)updateFullscreenExitBubbleURL:(const GURL&)url | 1981 - (void)updateFullscreenExitBubbleURL:(const GURL&)url |
1982 bubbleType:(FullscreenExitBubbleType)bubbleType { | 1982 bubbleType:(FullscreenExitBubbleType)bubbleType { |
1983 fullscreenUrl_ = url; | 1983 fullscreenUrl_ = url; |
1984 fullscreenBubbleType_ = bubbleType; | 1984 fullscreenBubbleType_ = bubbleType; |
1985 if (bubbleType == FEB_TYPE_NONE || | 1985 [self showFullscreenExitBubbleIfNecessary]; |
1986 bubbleType == FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION) { | |
1987 // Show no exit instruction bubble on Mac when in Browser Fullscreen. | |
1988 [self destroyFullscreenExitBubbleIfNecessary]; | |
1989 } else { | |
1990 if (!fullscreenExitBubbleController_.get()) { | |
1991 [self showFullscreenExitBubbleIfNecessary]; | |
1992 } | |
1993 [fullscreenExitBubbleController_.get() updateURL:url bubbleType:bubbleType]; | |
1994 } | |
1995 } | 1986 } |
1996 | 1987 |
1997 - (BOOL)isFullscreen { | 1988 - (BOOL)isFullscreen { |
1998 return (fullscreenWindow_.get() != nil) || | 1989 return (fullscreenWindow_.get() != nil) || |
1999 ([[self window] styleMask] & NSFullScreenWindowMask) || | 1990 ([[self window] styleMask] & NSFullScreenWindowMask) || |
2000 enteringFullscreen_; | 1991 enteringFullscreen_; |
2001 } | 1992 } |
2002 | 1993 |
2003 - (void)togglePresentationModeForLionOrLater:(id)sender { | 1994 - (void)togglePresentationModeForLionOrLater:(id)sender { |
2004 // Called only by the presentation mode toggle button. | 1995 // Called only by the presentation mode toggle button. |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2217 | 2208 |
2218 - (BOOL)supportsBookmarkBar { | 2209 - (BOOL)supportsBookmarkBar { |
2219 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2210 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2220 } | 2211 } |
2221 | 2212 |
2222 - (BOOL)isTabbedWindow { | 2213 - (BOOL)isTabbedWindow { |
2223 return browser_->is_type_tabbed(); | 2214 return browser_->is_type_tabbed(); |
2224 } | 2215 } |
2225 | 2216 |
2226 @end // @implementation BrowserWindowController(WindowType) | 2217 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |