OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #import "base/memory/scoped_nsobject.h" | 10 #import "base/memory/scoped_nsobject.h" |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 [self deregisterForContentViewResizeNotifications]; | 845 [self deregisterForContentViewResizeNotifications]; |
846 } | 846 } |
847 | 847 |
848 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window { | 848 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window { |
849 [self deregisterForContentViewResizeNotifications]; | 849 [self deregisterForContentViewResizeNotifications]; |
850 [self setPresentationModeInternal:NO forceDropdown:NO]; | 850 [self setPresentationModeInternal:NO forceDropdown:NO]; |
851 } | 851 } |
852 | 852 |
853 - (void)windowDidFailToExitFullScreen:(NSWindow*)window { | 853 - (void)windowDidFailToExitFullScreen:(NSWindow*)window { |
854 [self deregisterForContentViewResizeNotifications]; | 854 [self deregisterForContentViewResizeNotifications]; |
| 855 |
| 856 // Force a relayout to try and get the window back into a reasonable state. |
| 857 [self layoutSubviews]; |
855 } | 858 } |
856 | 859 |
857 - (void)enableBarVisibilityUpdates { | 860 - (void)enableBarVisibilityUpdates { |
858 // Early escape if there's nothing to do. | 861 // Early escape if there's nothing to do. |
859 if (barVisibilityUpdatesEnabled_) | 862 if (barVisibilityUpdatesEnabled_) |
860 return; | 863 return; |
861 | 864 |
862 barVisibilityUpdatesEnabled_ = YES; | 865 barVisibilityUpdatesEnabled_ = YES; |
863 | 866 |
864 if ([barVisibilityLocks_ count]) | 867 if ([barVisibilityLocks_ count]) |
865 [presentationModeController_ ensureOverlayShownWithAnimation:NO delay:NO]; | 868 [presentationModeController_ ensureOverlayShownWithAnimation:NO delay:NO]; |
866 else | 869 else |
867 [presentationModeController_ ensureOverlayHiddenWithAnimation:NO delay:NO]; | 870 [presentationModeController_ ensureOverlayHiddenWithAnimation:NO delay:NO]; |
868 } | 871 } |
869 | 872 |
870 - (void)disableBarVisibilityUpdates { | 873 - (void)disableBarVisibilityUpdates { |
871 // Early escape if there's nothing to do. | 874 // Early escape if there's nothing to do. |
872 if (!barVisibilityUpdatesEnabled_) | 875 if (!barVisibilityUpdatesEnabled_) |
873 return; | 876 return; |
874 | 877 |
875 barVisibilityUpdatesEnabled_ = NO; | 878 barVisibilityUpdatesEnabled_ = NO; |
876 [presentationModeController_ cancelAnimationAndTimers]; | 879 [presentationModeController_ cancelAnimationAndTimers]; |
877 } | 880 } |
878 | 881 |
879 @end // @implementation BrowserWindowController(Private) | 882 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |