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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 // tabstrip leaves enough room for the fullscreen button or presentation mode | 350 // tabstrip leaves enough room for the fullscreen button or presentation mode |
351 // toggle button on Lion. On non-Lion systems, the right indent needs to be | 351 // toggle button on Lion. On non-Lion systems, the right indent needs to be |
352 // adjusted to make room for the new tab button when an avatar is present. | 352 // adjusted to make room for the new tab button when an avatar is present. |
353 CGFloat rightIndent = 0; | 353 CGFloat rightIndent = 0; |
354 if (base::mac::IsOSLionOrLater() && | 354 if (base::mac::IsOSLionOrLater() && |
355 [[self window] isKindOfClass:[FramedBrowserWindow class]]) { | 355 [[self window] isKindOfClass:[FramedBrowserWindow class]]) { |
356 FramedBrowserWindow* window = | 356 FramedBrowserWindow* window = |
357 static_cast<FramedBrowserWindow*>([self window]); | 357 static_cast<FramedBrowserWindow*>([self window]); |
358 rightIndent += -[window fullScreenButtonOriginAdjustment].x; | 358 rightIndent += -[window fullScreenButtonOriginAdjustment].x; |
359 | 359 |
360 // The new avatar is wider than the default indentation, so we need to | 360 if ([self shouldUseNewAvatarButton]) { |
361 // account for its width. | 361 // The new avatar is wider than the default indentation, so we need to |
362 if ([self shouldUseNewAvatarButton]) | 362 // account for its width. |
363 rightIndent += NSWidth([avatarButton frame]) + kAvatarTabStripShrink; | 363 rightIndent += NSWidth([avatarButton frame]) + kAvatarTabStripShrink; |
| 364 |
| 365 // When the fullscreen icon is not displayed, return its width to the |
| 366 // tabstrip. |
| 367 if ([self isFullscreen]) |
| 368 rightIndent -= kFullscreenIconWidth; |
| 369 } |
364 } else if ([self shouldShowAvatar]) { | 370 } else if ([self shouldShowAvatar]) { |
365 rightIndent += kAvatarTabStripShrink + | 371 rightIndent += kAvatarTabStripShrink + |
366 NSWidth([avatarButton frame]) + kAvatarRightOffset; | 372 NSWidth([avatarButton frame]) + kAvatarRightOffset; |
367 } | 373 } |
368 [tabStripController_ setRightIndentForControls:rightIndent]; | 374 [tabStripController_ setRightIndentForControls:rightIndent]; |
369 | 375 |
370 // Go ahead and layout the tabs. | 376 // Go ahead and layout the tabs. |
371 [tabStripController_ layoutTabsWithoutAnimation]; | 377 [tabStripController_ layoutTabsWithoutAnimation]; |
372 | 378 |
373 return maxY; | 379 return maxY; |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 } | 1036 } |
1031 } | 1037 } |
1032 | 1038 |
1033 - (void)updateInfoBarTipVisibility { | 1039 - (void)updateInfoBarTipVisibility { |
1034 // If there's no toolbar then hide the infobar tip. | 1040 // If there's no toolbar then hide the infobar tip. |
1035 [infoBarContainerController_ | 1041 [infoBarContainerController_ |
1036 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; | 1042 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; |
1037 } | 1043 } |
1038 | 1044 |
1039 @end // @implementation BrowserWindowController(Private) | 1045 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |