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