| 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 #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 Loading... |
| 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 | |
| 196 CGFloat minX = NSMinX(contentBounds); | 188 CGFloat minX = NSMinX(contentBounds); |
| 197 CGFloat minY = NSMinY(contentBounds); | 189 CGFloat minY = NSMinY(contentBounds); |
| 198 CGFloat width = NSWidth(contentBounds); | 190 CGFloat width = NSWidth(contentBounds); |
| 199 | 191 |
| 200 BOOL useSimplifiedFullscreen = CommandLine::ForCurrentProcess()->HasSwitch( | 192 BOOL useSimplifiedFullscreen = CommandLine::ForCurrentProcess()->HasSwitch( |
| 201 switches::kEnableSimplifiedFullscreen); | 193 switches::kEnableSimplifiedFullscreen); |
| 202 | 194 |
| 203 // Suppress title drawing if necessary. | 195 // Suppress title drawing if necessary. |
| 204 if ([window respondsToSelector:@selector(setShouldHideTitle:)]) | 196 if ([window respondsToSelector:@selector(setShouldHideTitle:)]) |
| 205 [(id)window setShouldHideTitle:![self hasTitleBar]]; | 197 [(id)window setShouldHideTitle:![self hasTitleBar]]; |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 devTools->SetAllowOverlappingViews(allowOverlappingViews); | 1074 devTools->SetAllowOverlappingViews(allowOverlappingViews); |
| 1083 } | 1075 } |
| 1084 | 1076 |
| 1085 - (void)updateInfoBarTipVisibility { | 1077 - (void)updateInfoBarTipVisibility { |
| 1086 // If there's no toolbar then hide the infobar tip. | 1078 // If there's no toolbar then hide the infobar tip. |
| 1087 [infoBarContainerController_ | 1079 [infoBarContainerController_ |
| 1088 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; | 1080 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; |
| 1089 } | 1081 } |
| 1090 | 1082 |
| 1091 @end // @implementation BrowserWindowController(Private) | 1083 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |