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

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

Issue 1414033009: Implement a Menu Item to Hide the Toolbar in Fullscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and merge code Created 5 years, 1 month 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 1929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 } 1940 }
1941 1941
1942 - (void)updateFullscreenExitBubbleURL:(const GURL&)url 1942 - (void)updateFullscreenExitBubbleURL:(const GURL&)url
1943 bubbleType:(ExclusiveAccessBubbleType)bubbleType { 1943 bubbleType:(ExclusiveAccessBubbleType)bubbleType {
1944 fullscreenUrl_ = url; 1944 fullscreenUrl_ = url;
1945 exclusiveAccessBubbleType_ = bubbleType; 1945 exclusiveAccessBubbleType_ = bubbleType;
1946 [self layoutSubviews]; 1946 [self layoutSubviews];
1947 [self showFullscreenExitBubbleIfNecessary]; 1947 [self showFullscreenExitBubbleIfNecessary];
1948 } 1948 }
1949 1949
1950 - (void)toggleFullscreenToolbar {
1951 shouldHideFullscreenToolbar_ = !shouldHideFullscreenToolbar_;
1952
1953 if ([self isInAppKitFullscreen])
1954 [self updateFullscreenWithToolbar:!shouldHideFullscreenToolbar_];
1955 }
1956
1950 - (BOOL)isInAnyFullscreenMode { 1957 - (BOOL)isInAnyFullscreenMode {
1951 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen]; 1958 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen];
1952 } 1959 }
1953 1960
1954 - (BOOL)isInImmersiveFullscreen { 1961 - (BOOL)isInImmersiveFullscreen {
1955 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_; 1962 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_;
1956 } 1963 }
1957 1964
1958 - (BOOL)isInAppKitFullscreen { 1965 - (BOOL)isInAppKitFullscreen {
1959 return !exitingAppKitFullscreen_ && 1966 return !exitingAppKitFullscreen_ &&
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1997 [self exitImmersiveFullscreen]; 2004 [self exitImmersiveFullscreen];
1998 } 2005 }
1999 2006
2000 - (BOOL)inPresentationMode { 2007 - (BOOL)inPresentationMode {
2001 return presentationModeController_.get() && 2008 return presentationModeController_.get() &&
2002 [presentationModeController_ inPresentationMode] && 2009 [presentationModeController_ inPresentationMode] &&
2003 presentationModeController_.get().slidingStyle == 2010 presentationModeController_.get().slidingStyle ==
2004 fullscreen_mac::OMNIBOX_TABS_HIDDEN; 2011 fullscreen_mac::OMNIBOX_TABS_HIDDEN;
2005 } 2012 }
2006 2013
2014 - (BOOL)shouldHideFullscreenToolbar {
2015 return shouldHideFullscreenToolbar_;
2016 }
2017
2007 - (void)resizeFullscreenWindow { 2018 - (void)resizeFullscreenWindow {
2008 DCHECK([self isInAnyFullscreenMode]); 2019 DCHECK([self isInAnyFullscreenMode]);
2009 if (![self isInAnyFullscreenMode]) 2020 if (![self isInAnyFullscreenMode])
2010 return; 2021 return;
2011 2022
2012 NSWindow* window = [self window]; 2023 NSWindow* window = [self window];
2013 [window setFrame:[[window screen] frame] display:YES]; 2024 [window setFrame:[[window screen] frame] display:YES];
2014 [self layoutSubviews]; 2025 [self layoutSubviews];
2015 } 2026 }
2016 2027
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2078 2089
2079 - (BOOL)supportsBookmarkBar { 2090 - (BOOL)supportsBookmarkBar {
2080 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2091 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2081 } 2092 }
2082 2093
2083 - (BOOL)isTabbedWindow { 2094 - (BOOL)isTabbedWindow {
2084 return browser_->is_type_tabbed(); 2095 return browser_->is_type_tabbed();
2085 } 2096 }
2086 2097
2087 @end // @implementation BrowserWindowController(WindowType) 2098 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | chrome/browser/ui/cocoa/browser_window_controller_private.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698