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/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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 // If there is a profile avatar present, shift the button over by its | 331 // If there is a profile avatar present, shift the button over by its |
332 // width and some padding. | 332 // width and some padding. |
333 BrowserWindowController* bwc = | 333 BrowserWindowController* bwc = |
334 static_cast<BrowserWindowController*>([self windowController]); | 334 static_cast<BrowserWindowController*>([self windowController]); |
335 if ([bwc shouldShowAvatar]) { | 335 if ([bwc shouldShowAvatar]) { |
336 AvatarButtonController* avatarButtonVC = [bwc avatarButtonController]; | 336 AvatarButtonController* avatarButtonVC = [bwc avatarButtonController]; |
337 NSView* avatarButton = [avatarButtonVC view]; | 337 NSView* avatarButton = [avatarButtonVC view]; |
338 origin.x = -(NSWidth([avatarButton frame]) + 3); | 338 origin.x = -(NSWidth([avatarButton frame]) + 3); |
339 } else { | 339 } else { |
340 origin.x -= 5; | 340 origin.x -= 6; |
341 } | 341 } |
342 | 342 |
343 return origin; | 343 return origin; |
344 } | 344 } |
345 | 345 |
346 - (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view { | 346 - (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view { |
347 // WARNING: There is an obvious optimization opportunity here that you DO NOT | 347 // WARNING: There is an obvious optimization opportunity here that you DO NOT |
348 // want to take. To save painting cycles, you might think it would be a good | 348 // want to take. To save painting cycles, you might think it would be a good |
349 // idea to call out to the default implementation only if no theme were | 349 // idea to call out to the default implementation only if no theme were |
350 // drawn. In reality, however, if you fail to call the default | 350 // drawn. In reality, however, if you fail to call the default |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 if (titleColor) | 545 if (titleColor) |
546 return titleColor; | 546 return titleColor; |
547 | 547 |
548 if (incognito) | 548 if (incognito) |
549 return [NSColor whiteColor]; | 549 return [NSColor whiteColor]; |
550 else | 550 else |
551 return [NSColor windowFrameTextColor]; | 551 return [NSColor windowFrameTextColor]; |
552 } | 552 } |
553 | 553 |
554 @end | 554 @end |
OLD | NEW |