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_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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 // mode, it needs to draw over the bookmark bar and part of the toolbar. | 782 // mode, it needs to draw over the bookmark bar and part of the toolbar. |
783 [[infoBarContainerController_ view] removeFromSuperview]; | 783 [[infoBarContainerController_ view] removeFromSuperview]; |
784 NSView* infoBarDest = [[self window] contentView]; | 784 NSView* infoBarDest = [[self window] contentView]; |
785 [infoBarDest addSubview:[infoBarContainerController_ view] | 785 [infoBarDest addSubview:[infoBarContainerController_ view] |
786 positioned:fullscreen ? NSWindowBelow : NSWindowAbove | 786 positioned:fullscreen ? NSWindowBelow : NSWindowAbove |
787 relativeTo:fullscreen ? nil | 787 relativeTo:fullscreen ? nil |
788 : [toolbarController_ view]]; | 788 : [toolbarController_ view]]; |
789 } | 789 } |
790 | 790 |
791 - (void)showFullscreenExitBubbleIfNecessary { | 791 - (void)showFullscreenExitBubbleIfNecessary { |
792 if (!browser_->IsFullscreenForTabOrPending()) { | |
793 return; | |
794 } | |
795 | |
796 [presentationModeController_ ensureOverlayHiddenWithAnimation:NO delay:NO]; | 792 [presentationModeController_ ensureOverlayHiddenWithAnimation:NO delay:NO]; |
797 | 793 |
| 794 [fullscreenExitBubbleController_ closeImmediately]; |
798 fullscreenExitBubbleController_.reset( | 795 fullscreenExitBubbleController_.reset( |
799 [[FullscreenExitBubbleController alloc] | 796 [[FullscreenExitBubbleController alloc] |
800 initWithOwner:self | 797 initWithOwner:self |
801 browser:browser_.get() | 798 browser:browser_.get() |
802 url:fullscreenUrl_ | 799 url:fullscreenUrl_ |
803 bubbleType:fullscreenBubbleType_]); | 800 bubbleType:fullscreenBubbleType_]); |
804 NSView* contentView = [[self window] contentView]; | |
805 CGFloat maxWidth = NSWidth([contentView frame]); | |
806 CGFloat maxY = NSMaxY([[[self window] contentView] frame]); | |
807 [fullscreenExitBubbleController_ | |
808 positionInWindowAtTop:maxY width:maxWidth]; | |
809 [fullscreenExitBubbleController_ showWindow]; | 801 [fullscreenExitBubbleController_ showWindow]; |
810 } | 802 } |
811 | 803 |
812 - (void)destroyFullscreenExitBubbleIfNecessary { | 804 - (void)destroyFullscreenExitBubbleIfNecessary { |
813 [fullscreenExitBubbleController_ closeImmediately]; | 805 [fullscreenExitBubbleController_ closeImmediately]; |
814 fullscreenExitBubbleController_.reset(); | 806 fullscreenExitBubbleController_.reset(); |
815 } | 807 } |
816 | 808 |
817 - (void)contentViewDidResize:(NSNotification*)notification { | 809 - (void)contentViewDidResize:(NSNotification*)notification { |
818 [self layoutSubviews]; | 810 [self layoutSubviews]; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 - (void)disableBarVisibilityUpdates { | 898 - (void)disableBarVisibilityUpdates { |
907 // Early escape if there's nothing to do. | 899 // Early escape if there's nothing to do. |
908 if (!barVisibilityUpdatesEnabled_) | 900 if (!barVisibilityUpdatesEnabled_) |
909 return; | 901 return; |
910 | 902 |
911 barVisibilityUpdatesEnabled_ = NO; | 903 barVisibilityUpdatesEnabled_ = NO; |
912 [presentationModeController_ cancelAnimationAndTimers]; | 904 [presentationModeController_ cancelAnimationAndTimers]; |
913 } | 905 } |
914 | 906 |
915 @end // @implementation BrowserWindowController(Private) | 907 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |