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 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1943 return owner ? [barVisibilityLocks_ containsObject:owner] | 1943 return owner ? [barVisibilityLocks_ containsObject:owner] |
1944 : [barVisibilityLocks_ count]; | 1944 : [barVisibilityLocks_ count]; |
1945 } | 1945 } |
1946 | 1946 |
1947 - (void)lockBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate { | 1947 - (void)lockBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate { |
1948 if (![self isBarVisibilityLockedForOwner:owner]) { | 1948 if (![self isBarVisibilityLockedForOwner:owner]) { |
1949 [barVisibilityLocks_ addObject:owner]; | 1949 [barVisibilityLocks_ addObject:owner]; |
1950 | 1950 |
1951 // If enabled, show the overlay if necessary (and if the fullscreen | 1951 // If enabled, show the overlay if necessary (and if the fullscreen |
1952 // toolbar is hidden). | 1952 // toolbar is hidden). |
1953 if (barVisibilityUpdatesEnabled_) { | 1953 if (barVisibilityUpdatesEnabled_) |
1954 [fullscreenToolbarController_ lockBarVisibilityWithAnimation:animate]; | 1954 [fullscreenToolbarController_ ensureOverlayShownWithAnimation:animate]; |
1955 } | |
1956 } | 1955 } |
1957 } | 1956 } |
1958 | 1957 |
1959 - (void)releaseBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate { | 1958 - (void)releaseBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate { |
1960 if ([self isBarVisibilityLockedForOwner:owner]) { | 1959 if ([self isBarVisibilityLockedForOwner:owner]) { |
1961 [barVisibilityLocks_ removeObject:owner]; | 1960 [barVisibilityLocks_ removeObject:owner]; |
1962 | 1961 |
1963 // If enabled, hide the overlay if necessary (and if the fullscreen | 1962 // If enabled, hide the overlay if necessary (and if the fullscreen |
1964 // toolbar is hidden). | 1963 // toolbar is hidden). |
1965 if (barVisibilityUpdatesEnabled_ && | 1964 if (barVisibilityUpdatesEnabled_ && ![barVisibilityLocks_ count]) |
1966 ![barVisibilityLocks_ count]) { | 1965 [fullscreenToolbarController_ ensureOverlayHiddenWithAnimation:animate]; |
1967 [fullscreenToolbarController_ releaseBarVisibilityWithAnimation:animate]; | |
1968 } | |
1969 } | 1966 } |
1970 } | 1967 } |
1971 | 1968 |
1972 - (BOOL)floatingBarHasFocus { | 1969 - (BOOL)floatingBarHasFocus { |
1973 NSResponder* focused = [[self window] firstResponder]; | 1970 NSResponder* focused = [[self window] firstResponder]; |
1974 return [focused isKindOfClass:[AutocompleteTextFieldEditor class]]; | 1971 return [focused isKindOfClass:[AutocompleteTextFieldEditor class]]; |
1975 } | 1972 } |
1976 | 1973 |
1977 - (ExclusiveAccessController*)exclusiveAccessController { | 1974 - (ExclusiveAccessController*)exclusiveAccessController { |
1978 return exclusiveAccessController_.get(); | 1975 return exclusiveAccessController_.get(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2010 | 2007 |
2011 - (NSRect)savedRegularWindowFrame { | 2008 - (NSRect)savedRegularWindowFrame { |
2012 return savedRegularWindowFrame_; | 2009 return savedRegularWindowFrame_; |
2013 } | 2010 } |
2014 | 2011 |
2015 - (BOOL)isFullscreenTransitionInProgress { | 2012 - (BOOL)isFullscreenTransitionInProgress { |
2016 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; | 2013 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; |
2017 } | 2014 } |
2018 | 2015 |
2019 @end // @implementation BrowserWindowController(WindowType) | 2016 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |