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

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

Issue 560913004: Revert of Mac: Fix rounded corners on browser windows on retina display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge conflicts. Created 6 years, 3 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
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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 // If the relayout shifts the content area up or down, let the renderer know. 513 // If the relayout shifts the content area up or down, let the renderer know.
514 if (contentShifted) { 514 if (contentShifted) {
515 if (WebContents* contents = 515 if (WebContents* contents =
516 browser_->tab_strip_model()->GetActiveWebContents()) { 516 browser_->tab_strip_model()->GetActiveWebContents()) {
517 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView()) 517 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView())
518 rwhv->WindowFrameChanged(); 518 rwhv->WindowFrameChanged();
519 } 519 }
520 } 520 }
521 } 521 }
522 522
523 - (void)updateRoundedBottomCorners {
524 [[self tabContentArea] setRoundedBottomCorners:![self isInAnyFullscreenMode]];
525 }
526
527 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression { 523 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression {
528 CGFloat newHeight = 524 CGFloat newHeight =
529 [toolbarController_ desiredHeightForCompression:compression]; 525 [toolbarController_ desiredHeightForCompression:compression];
530 NSRect toolbarFrame = [[toolbarController_ view] frame]; 526 NSRect toolbarFrame = [[toolbarController_ view] frame];
531 CGFloat deltaH = newHeight - toolbarFrame.size.height; 527 CGFloat deltaH = newHeight - toolbarFrame.size.height;
532 528
533 if (deltaH == 0) 529 if (deltaH == 0)
534 return; 530 return;
535 531
536 toolbarFrame.size.height = newHeight; 532 toolbarFrame.size.height = newHeight;
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 909
914 if (notification) // For System Fullscreen when non-nil. 910 if (notification) // For System Fullscreen when non-nil.
915 [self deregisterForContentViewResizeNotifications]; 911 [self deregisterForContentViewResizeNotifications];
916 enteringAppKitFullscreen_ = NO; 912 enteringAppKitFullscreen_ = NO;
917 enteringImmersiveFullscreen_ = NO; 913 enteringImmersiveFullscreen_ = NO;
918 enteringPresentationMode_ = NO; 914 enteringPresentationMode_ = NO;
919 915
920 [self showFullscreenExitBubbleIfNecessary]; 916 [self showFullscreenExitBubbleIfNecessary];
921 browser_->WindowFullscreenStateChanged(); 917 browser_->WindowFullscreenStateChanged();
922 [[[self window] cr_windowView] setWantsLayer:windowViewWantsLayer_]; 918 [[[self window] cr_windowView] setWantsLayer:windowViewWantsLayer_];
923 [self updateRoundedBottomCorners];
924 } 919 }
925 920
926 - (void)windowWillExitFullScreen:(NSNotification*)notification { 921 - (void)windowWillExitFullScreen:(NSNotification*)notification {
927 if (notification) // For System Fullscreen when non-nil. 922 if (notification) // For System Fullscreen when non-nil.
928 [self registerForContentViewResizeNotifications]; 923 [self registerForContentViewResizeNotifications];
929 [self destroyFullscreenExitBubbleIfNecessary]; 924 [self destroyFullscreenExitBubbleIfNecessary];
930 [self adjustUIForExitingFullscreenAndStopOmniboxSliding]; 925 [self adjustUIForExitingFullscreenAndStopOmniboxSliding];
931 } 926 }
932 927
933 - (void)windowDidExitFullScreen:(NSNotification*)notification { 928 - (void)windowDidExitFullScreen:(NSNotification*)notification {
934 if (notification) // For System Fullscreen when non-nil. 929 if (notification) // For System Fullscreen when non-nil.
935 [self deregisterForContentViewResizeNotifications]; 930 [self deregisterForContentViewResizeNotifications];
936 browser_->WindowFullscreenStateChanged(); 931 browser_->WindowFullscreenStateChanged();
937 [self updateRoundedBottomCorners];
938 } 932 }
939 933
940 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window { 934 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window {
941 [self deregisterForContentViewResizeNotifications]; 935 [self deregisterForContentViewResizeNotifications];
942 enteringAppKitFullscreen_ = NO; 936 enteringAppKitFullscreen_ = NO;
943 [self adjustUIForExitingFullscreenAndStopOmniboxSliding]; 937 [self adjustUIForExitingFullscreenAndStopOmniboxSliding];
944 } 938 }
945 939
946 - (void)windowDidFailToExitFullScreen:(NSWindow*)window { 940 - (void)windowDidFailToExitFullScreen:(NSWindow*)window {
947 [self deregisterForContentViewResizeNotifications]; 941 [self deregisterForContentViewResizeNotifications];
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 1132
1139 - (void)exitAppKitFullscreen { 1133 - (void)exitAppKitFullscreen {
1140 DCHECK(base::mac::IsOSLionOrLater()); 1134 DCHECK(base::mac::IsOSLionOrLater());
1141 if (FramedBrowserWindow* framedBrowserWindow = 1135 if (FramedBrowserWindow* framedBrowserWindow =
1142 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { 1136 base::mac::ObjCCast<FramedBrowserWindow>([self window])) {
1143 [framedBrowserWindow toggleSystemFullScreen]; 1137 [framedBrowserWindow toggleSystemFullScreen];
1144 } 1138 }
1145 } 1139 }
1146 1140
1147 @end // @implementation BrowserWindowController(Private) 1141 @end // @implementation BrowserWindowController(Private)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.h ('k') | chrome/browser/ui/cocoa/fast_resize_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698