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

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

Issue 481273002: Mac: Fix a recently introduced layering bug. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 } 670 }
671 if (showDropdown) { 671 if (showDropdown) {
672 // Turn on layered mode for the window's root view for the entry 672 // Turn on layered mode for the window's root view for the entry
673 // animation. Without this, the OS fullscreen animation for entering 673 // animation. Without this, the OS fullscreen animation for entering
674 // fullscreen mode does not correctly draw the tab strip. 674 // fullscreen mode does not correctly draw the tab strip.
675 // It will be turned off (set back to NO) when the animation finishes, 675 // It will be turned off (set back to NO) when the animation finishes,
676 // in -windowDidEnterFullScreen:. 676 // in -windowDidEnterFullScreen:.
677 // Leaving wantsLayer on for the duration of presentation mode causes 677 // Leaving wantsLayer on for the duration of presentation mode causes
678 // performance issues when the dropdown is animated in/out. It also does 678 // performance issues when the dropdown is animated in/out. It also does
679 // not seem to be required for the exit animation. 679 // not seem to be required for the exit animation.
680 [[[self window] cr_windowView] setWantsLayer:YES]; 680 windowViewWantsLayer_ = [[[self window] cr_windowView] wantsLayer];
681 [[[self window] cr_windowView] cr_setWantsLayer:YES];
ccameron 2014/08/19 01:08:25 cr_setWantsLayer is dead now.
erikchen 2014/08/19 01:10:51 Done.
681 } 682 }
682 NSView* contentView = [[self window] contentView]; 683 NSView* contentView = [[self window] contentView];
683 [presentationModeController_ enterPresentationModeForContentView:contentView 684 [presentationModeController_ enterPresentationModeForContentView:contentView
684 showDropdown:showDropdown]; 685 showDropdown:showDropdown];
685 } else { 686 } else {
686 [presentationModeController_ exitPresentationMode]; 687 [presentationModeController_ exitPresentationMode];
687 presentationModeController_.reset(); 688 presentationModeController_.reset();
688 } 689 }
689 690
690 [self adjustUIForPresentationMode:presentationMode]; 691 [self adjustUIForPresentationMode:presentationMode];
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 894
894 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 895 const CommandLine* command_line = CommandLine::ForCurrentProcess();
895 if (command_line->HasSwitch(switches::kEnableSimplifiedFullscreen) && 896 if (command_line->HasSwitch(switches::kEnableSimplifiedFullscreen) &&
896 fullscreenUrl_.is_empty()) { 897 fullscreenUrl_.is_empty()) {
897 fullscreenModeController_.reset([[FullscreenModeController alloc] 898 fullscreenModeController_.reset([[FullscreenModeController alloc]
898 initWithBrowserWindowController:self]); 899 initWithBrowserWindowController:self]);
899 } 900 }
900 901
901 [self showFullscreenExitBubbleIfNecessary]; 902 [self showFullscreenExitBubbleIfNecessary];
902 browser_->WindowFullscreenStateChanged(); 903 browser_->WindowFullscreenStateChanged();
903 [[[self window] cr_windowView] setWantsLayer:NO]; 904 [[[self window] cr_windowView] cr_setWantsLayer:windowViewWantsLayer_];
904 [self updateRoundedBottomCorners]; 905 [self updateRoundedBottomCorners];
905 } 906 }
906 907
907 - (void)windowWillExitFullScreen:(NSNotification*)notification { 908 - (void)windowWillExitFullScreen:(NSNotification*)notification {
908 if (notification) // For System Fullscreen when non-nil. 909 if (notification) // For System Fullscreen when non-nil.
909 [self registerForContentViewResizeNotifications]; 910 [self registerForContentViewResizeNotifications];
910 fullscreenModeController_.reset(); 911 fullscreenModeController_.reset();
911 [self destroyFullscreenExitBubbleIfNecessary]; 912 [self destroyFullscreenExitBubbleIfNecessary];
912 [self setPresentationModeInternal:NO forceDropdown:NO]; 913 [self setPresentationModeInternal:NO forceDropdown:NO];
913 } 914 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 devTools->SetAllowOverlappingViews(allowOverlappingViews); 1066 devTools->SetAllowOverlappingViews(allowOverlappingViews);
1066 } 1067 }
1067 1068
1068 - (void)updateInfoBarTipVisibility { 1069 - (void)updateInfoBarTipVisibility {
1069 // If there's no toolbar then hide the infobar tip. 1070 // If there's no toolbar then hide the infobar tip.
1070 [infoBarContainerController_ 1071 [infoBarContainerController_
1071 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; 1072 setShouldSuppressTopInfoBarTip:![self hasToolbar]];
1072 } 1073 }
1073 1074
1074 @end // @implementation BrowserWindowController(Private) 1075 @end // @implementation BrowserWindowController(Private)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698