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

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

Issue 419683008: mac: Toolbar renders incorrectly when downloads bar is open. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from shess. Created 6 years, 5 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 178 }
179 179
180 - (void)layoutSubviews { 180 - (void)layoutSubviews {
181 // With the exception of the top tab strip, the subviews which we lay out are 181 // With the exception of the top tab strip, the subviews which we lay out are
182 // subviews of the content view, so we mainly work in the content view's 182 // subviews of the content view, so we mainly work in the content view's
183 // coordinate system. Note, however, that the content view's coordinate system 183 // coordinate system. Note, however, that the content view's coordinate system
184 // and the window's base coordinate system should coincide. 184 // and the window's base coordinate system should coincide.
185 NSWindow* window = [self window]; 185 NSWindow* window = [self window];
186 NSView* contentView = [window contentView]; 186 NSView* contentView = [window contentView];
187 NSRect contentBounds = [contentView bounds]; 187 NSRect contentBounds = [contentView bounds];
188
189 // Lay out the chromeContentView.
190 NSView* chromeContentView = [self chromeContentView];
191 BOOL autoresizesSubviews = [chromeContentView autoresizesSubviews];
192 [chromeContentView setAutoresizesSubviews:NO];
193 [chromeContentView setFrame:contentBounds];
194 [chromeContentView setAutoresizesSubviews:autoresizesSubviews];
195
188 CGFloat minX = NSMinX(contentBounds); 196 CGFloat minX = NSMinX(contentBounds);
189 CGFloat minY = NSMinY(contentBounds); 197 CGFloat minY = NSMinY(contentBounds);
190 CGFloat width = NSWidth(contentBounds); 198 CGFloat width = NSWidth(contentBounds);
191 199
192 BOOL useSimplifiedFullscreen = CommandLine::ForCurrentProcess()->HasSwitch( 200 BOOL useSimplifiedFullscreen = CommandLine::ForCurrentProcess()->HasSwitch(
193 switches::kEnableSimplifiedFullscreen); 201 switches::kEnableSimplifiedFullscreen);
194 202
195 // Suppress title drawing if necessary. 203 // Suppress title drawing if necessary.
196 if ([window respondsToSelector:@selector(setShouldHideTitle:)]) 204 if ([window respondsToSelector:@selector(setShouldHideTitle:)])
197 [(id)window setShouldHideTitle:![self hasTitleBar]]; 205 [(id)window setShouldHideTitle:![self hasTitleBar]];
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 devTools->SetAllowOverlappingViews(allowOverlappingViews); 1082 devTools->SetAllowOverlappingViews(allowOverlappingViews);
1075 } 1083 }
1076 1084
1077 - (void)updateInfoBarTipVisibility { 1085 - (void)updateInfoBarTipVisibility {
1078 // If there's no toolbar then hide the infobar tip. 1086 // If there's no toolbar then hide the infobar tip.
1079 [infoBarContainerController_ 1087 [infoBarContainerController_
1080 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; 1088 setShouldSuppressTopInfoBarTip:![self hasToolbar]];
1081 } 1089 }
1082 1090
1083 @end // @implementation BrowserWindowController(Private) 1091 @end // @implementation BrowserWindowController(Private)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698