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

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

Issue 7584015: [Mac] Fix avatar size after new icon drop. The image scaling behaves weird in a button cell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Different approach Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/browser/avatar_button.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import "base/memory/scoped_nsobject.h" 10 #import "base/memory/scoped_nsobject.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 CGFloat rightIndent = 0; 364 CGFloat rightIndent = 0;
365 if ([self shouldShowAvatar]) 365 if ([self shouldShowAvatar])
366 rightIndent += (kAvatarTabStripShrink + possibleExtraShiftForLion); 366 rightIndent += (kAvatarTabStripShrink + possibleExtraShiftForLion);
367 [tabStripController_ setRightIndentForControls:rightIndent]; 367 [tabStripController_ setRightIndentForControls:rightIndent];
368 368
369 // Go ahead and layout the tabs. 369 // Go ahead and layout the tabs.
370 [tabStripController_ layoutTabsWithoutAnimation]; 370 [tabStripController_ layoutTabsWithoutAnimation];
371 371
372 // Now lay out incognito badge together with the tab strip. 372 // Now lay out incognito badge together with the tab strip.
373 if (avatarButton_.get()) { 373 if (avatarButton_.get()) {
374 CGFloat sizeSquare = tabStripHeight - 5.0; 374 [avatarButton_ setFrameSize:NSMakeSize(tabStripHeight,
375 [avatarButton_ setFrameSize:NSMakeSize(sizeSquare, sizeSquare)]; 375 tabStripHeight - 5.0)];
376 376
377 // Actually place the badge *above* |maxY|, by +2 to miss the divider. On 377 // Actually place the badge *above* |maxY|, by +2 to miss the divider. On
378 // Lion or later, shift the badge left to move it away from the fullscreen 378 // Lion or later, shift the badge left to move it away from the fullscreen
379 // button. 379 // button.
380 CGFloat badgeOffset = kAvatarRightOffset + possibleExtraShiftForLion; 380 CGFloat badgeOffset = kAvatarRightOffset + possibleExtraShiftForLion;
381 NSPoint origin = 381 NSPoint origin =
382 NSMakePoint(width - NSWidth([avatarButton_ frame]) - badgeOffset, 382 NSMakePoint(width - NSWidth([avatarButton_ frame]) - badgeOffset,
383 maxY + 2); 383 maxY + 2);
384 [avatarButton_ setFrameOrigin:origin]; 384 [avatarButton_ setFrameOrigin:origin];
385 [avatarButton_ setHidden:NO]; // Make sure it's shown. 385 [avatarButton_ setHidden:NO]; // Make sure it's shown.
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 - (void)disableBarVisibilityUpdates { 870 - (void)disableBarVisibilityUpdates {
871 // Early escape if there's nothing to do. 871 // Early escape if there's nothing to do.
872 if (!barVisibilityUpdatesEnabled_) 872 if (!barVisibilityUpdatesEnabled_)
873 return; 873 return;
874 874
875 barVisibilityUpdatesEnabled_ = NO; 875 barVisibilityUpdatesEnabled_ = NO;
876 [presentationModeController_ cancelAnimationAndTimers]; 876 [presentationModeController_ cancelAnimationAndTimers];
877 } 877 }
878 878
879 @end // @implementation BrowserWindowController(Private) 879 @end // @implementation BrowserWindowController(Private)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser/avatar_button.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698