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

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

Issue 2256993002: [Mac] Reworked FullscreenToolbarController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for erikchen Created 4 years, 4 months 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 #include <utility> 9 #include <utility>
10 10
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 [window setFrame:[[window screen] frame] display:YES]; 1977 [window setFrame:[[window screen] frame] display:YES];
1978 [self layoutSubviews]; 1978 [self layoutSubviews];
1979 } 1979 }
1980 1980
1981 - (BOOL)isBarVisibilityLockedForOwner:(id)owner { 1981 - (BOOL)isBarVisibilityLockedForOwner:(id)owner {
1982 DCHECK(owner); 1982 DCHECK(owner);
1983 DCHECK(barVisibilityLocks_); 1983 DCHECK(barVisibilityLocks_);
1984 return [barVisibilityLocks_ containsObject:owner]; 1984 return [barVisibilityLocks_ containsObject:owner];
1985 } 1985 }
1986 1986
1987 - (void)lockBarVisibilityForOwner:(id)owner 1987 - (void)lockBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate {
1988 withAnimation:(BOOL)animate
1989 delay:(BOOL)delay {
1990 if (![self isBarVisibilityLockedForOwner:owner]) { 1988 if (![self isBarVisibilityLockedForOwner:owner]) {
1991 [barVisibilityLocks_ addObject:owner]; 1989 [barVisibilityLocks_ addObject:owner];
1992 1990
1993 // If enabled, show the overlay if necessary (and if the fullscreen 1991 // If enabled, show the overlay if necessary (and if the fullscreen
1994 // toolbar is hidden). 1992 // toolbar is hidden).
1995 if (barVisibilityUpdatesEnabled_) { 1993 if (barVisibilityUpdatesEnabled_) {
1996 [fullscreenToolbarController_ ensureOverlayShownWithAnimation:animate 1994 [fullscreenToolbarController_ ensureOverlayShownWithAnimation:animate];
1997 delay:delay];
1998 } 1995 }
1999 } 1996 }
2000 } 1997 }
2001 1998
2002 - (void)releaseBarVisibilityForOwner:(id)owner 1999 - (void)releaseBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate {
2003 withAnimation:(BOOL)animate
2004 delay:(BOOL)delay {
2005 if ([self isBarVisibilityLockedForOwner:owner]) { 2000 if ([self isBarVisibilityLockedForOwner:owner]) {
2006 [barVisibilityLocks_ removeObject:owner]; 2001 [barVisibilityLocks_ removeObject:owner];
2007 2002
2008 // If enabled, hide the overlay if necessary (and if the fullscreen 2003 // If enabled, hide the overlay if necessary (and if the fullscreen
2009 // toolbar is hidden). 2004 // toolbar is hidden).
2010 if (barVisibilityUpdatesEnabled_ && 2005 if (barVisibilityUpdatesEnabled_ &&
2011 ![barVisibilityLocks_ count]) { 2006 ![barVisibilityLocks_ count]) {
2012 [fullscreenToolbarController_ ensureOverlayHiddenWithAnimation:animate 2007 [fullscreenToolbarController_ ensureOverlayHiddenWithAnimation:animate];
2013 delay:delay];
2014 } 2008 }
2015 } 2009 }
2016 } 2010 }
2017 2011
2018 - (BOOL)floatingBarHasFocus { 2012 - (BOOL)floatingBarHasFocus {
2019 NSResponder* focused = [[self window] firstResponder]; 2013 NSResponder* focused = [[self window] firstResponder];
2020 return [focused isKindOfClass:[AutocompleteTextFieldEditor class]]; 2014 return [focused isKindOfClass:[AutocompleteTextFieldEditor class]];
2021 } 2015 }
2022 2016
2023 - (ExclusiveAccessController*)exclusiveAccessController { 2017 - (ExclusiveAccessController*)exclusiveAccessController {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 2050
2057 - (NSRect)savedRegularWindowFrame { 2051 - (NSRect)savedRegularWindowFrame {
2058 return savedRegularWindowFrame_; 2052 return savedRegularWindowFrame_;
2059 } 2053 }
2060 2054
2061 - (BOOL)isFullscreenTransitionInProgress { 2055 - (BOOL)isFullscreenTransitionInProgress {
2062 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; 2056 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_;
2063 } 2057 }
2064 2058
2065 @end // @implementation BrowserWindowController(WindowType) 2059 @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.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698