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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 fullscreen:(BOOL)fullscreen { | 332 fullscreen:(BOOL)fullscreen { |
333 // Nothing to do if no tab strip. | 333 // Nothing to do if no tab strip. |
334 if (![self hasTabStrip]) | 334 if (![self hasTabStrip]) |
335 return maxY; | 335 return maxY; |
336 | 336 |
337 NSView* tabStripView = [self tabStripView]; | 337 NSView* tabStripView = [self tabStripView]; |
338 CGFloat tabStripHeight = NSHeight([tabStripView frame]); | 338 CGFloat tabStripHeight = NSHeight([tabStripView frame]); |
339 maxY -= tabStripHeight; | 339 maxY -= tabStripHeight; |
340 [tabStripView setFrame:NSMakeRect(0, maxY, width, tabStripHeight)]; | 340 [tabStripView setFrame:NSMakeRect(0, maxY, width, tabStripHeight)]; |
341 | 341 |
| 342 // In Yosemite fullscreen, manually add the fullscreen controls to the tab |
| 343 // strip. |
| 344 BOOL addControlsInFullscreen = |
| 345 [self isInOrEnteringAppKitFullscreen] && base::mac::IsOSYosemiteOrLater(); |
| 346 |
342 // Set left indentation based on fullscreen mode status. | 347 // Set left indentation based on fullscreen mode status. |
343 [tabStripController_ setLeftIndentForControls:(fullscreen ? 0 : | 348 CGFloat leftIndent = 0; |
344 [[tabStripController_ class] defaultLeftIndentForControls])]; | 349 if (!fullscreen || addControlsInFullscreen) |
| 350 leftIndent = [[tabStripController_ class] defaultLeftIndentForControls]; |
| 351 [tabStripController_ setLeftIndentForControls:leftIndent]; |
| 352 |
| 353 if (addControlsInFullscreen) |
| 354 [tabStripController_ addWindowControls]; |
| 355 else |
| 356 [tabStripController_ removeWindowControls]; |
345 | 357 |
346 // Lay out the icognito/avatar badge because calculating the indentation on | 358 // Lay out the icognito/avatar badge because calculating the indentation on |
347 // the right depends on it. | 359 // the right depends on it. |
348 NSView* avatarButton = [avatarButtonController_ view]; | 360 NSView* avatarButton = [avatarButtonController_ view]; |
349 if ([self shouldShowAvatar]) { | 361 if ([self shouldShowAvatar]) { |
350 CGFloat badgeXOffset = -kAvatarRightOffset; | 362 CGFloat badgeXOffset = -kAvatarRightOffset; |
351 CGFloat badgeYOffset = 0; | 363 CGFloat badgeYOffset = 0; |
352 CGFloat buttonHeight = NSHeight([avatarButton frame]); | 364 CGFloat buttonHeight = NSHeight([avatarButton frame]); |
353 | 365 |
354 if ([self shouldUseNewAvatarButton]) { | 366 if ([self shouldUseNewAvatarButton]) { |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 } | 1154 } |
1143 | 1155 |
1144 - (void)exitAppKitFullscreen { | 1156 - (void)exitAppKitFullscreen { |
1145 if (FramedBrowserWindow* framedBrowserWindow = | 1157 if (FramedBrowserWindow* framedBrowserWindow = |
1146 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { | 1158 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { |
1147 [framedBrowserWindow toggleSystemFullScreen]; | 1159 [framedBrowserWindow toggleSystemFullScreen]; |
1148 } | 1160 } |
1149 } | 1161 } |
1150 | 1162 |
1151 @end // @implementation BrowserWindowController(Private) | 1163 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |