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

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

Issue 117533002: [Mac] Redesign of the avatar menu button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tabstrip width Created 6 years, 11 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
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/framed_browser_window.h" 5 #import "chrome/browser/ui/cocoa/framed_browser_window.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/global_keyboard_shortcuts_mac.h" 8 #include "chrome/browser/global_keyboard_shortcuts_mac.h"
9 #include "chrome/browser/profiles/profile_info_util.h" 9 #include "chrome/browser/profiles/profile_info_util.h"
10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 [super toggleFullScreen:nil]; 307 [super toggleFullScreen:nil];
308 } 308 }
309 309
310 - (NSPoint)fullScreenButtonOriginAdjustment { 310 - (NSPoint)fullScreenButtonOriginAdjustment {
311 if (!hasTabStrip_) 311 if (!hasTabStrip_)
312 return NSZeroPoint; 312 return NSZeroPoint;
313 313
314 // Vertically center the button. 314 // Vertically center the button.
315 NSPoint origin = NSMakePoint(0, -6); 315 NSPoint origin = NSMakePoint(0, -6);
316 316
317 // If there is a profile avatar present, shift the button over by its 317 // If there is a profile avatar icon present, shift the button over by its
318 // width and some padding. 318 // width and some padding. The new avatar button is displayed to the right
319 // of the fullscreen icon, so it doesn't need to be shifted.
319 BrowserWindowController* bwc = 320 BrowserWindowController* bwc =
320 static_cast<BrowserWindowController*>([self windowController]); 321 static_cast<BrowserWindowController*>([self windowController]);
321 if ([bwc shouldShowAvatar]) { 322 if ([bwc shouldShowAvatar] && ![bwc shouldUseNewAvatarButton]) {
322 AvatarButtonController* avatarButtonVC = [bwc avatarButtonController]; 323 NSView* avatarButton = [[bwc avatarButtonController] view];
323 NSView* avatarButton = [avatarButtonVC view];
324 origin.x = -(NSWidth([avatarButton frame]) + 3); 324 origin.x = -(NSWidth([avatarButton frame]) + 3);
325 } else { 325 } else {
326 origin.x -= 6; 326 origin.x -= 6;
327 } 327 }
328 328
329 return origin; 329 return origin;
330 } 330 }
331 331
332 - (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view { 332 - (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view {
333 // WARNING: There is an obvious optimization opportunity here that you DO NOT 333 // WARNING: There is an obvious optimization opportunity here that you DO NOT
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 ThemedWindowStyle windowStyle = [self themedWindowStyle]; 502 ThemedWindowStyle windowStyle = [self themedWindowStyle];
503 BOOL incognito = windowStyle & THEMED_INCOGNITO; 503 BOOL incognito = windowStyle & THEMED_INCOGNITO;
504 504
505 if (incognito) 505 if (incognito)
506 return [NSColor whiteColor]; 506 return [NSColor whiteColor];
507 else 507 else
508 return [NSColor windowFrameTextColor]; 508 return [NSColor windowFrameTextColor];
509 } 509 }
510 510
511 @end 511 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698