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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 533153003: Revert "[Merge] [Mac] Add tab and keyboard navigation to the new avatar bubble" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" 7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
8 8
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 const CGFloat kVerticalSpacing = 16.0; 79 const CGFloat kVerticalSpacing = 16.0;
80 const CGFloat kSmallVerticalSpacing = 10.0; 80 const CGFloat kSmallVerticalSpacing = 10.0;
81 const CGFloat kHorizontalSpacing = 16.0; 81 const CGFloat kHorizontalSpacing = 16.0;
82 const CGFloat kTitleFontSize = 15.0; 82 const CGFloat kTitleFontSize = 15.0;
83 const CGFloat kTextFontSize = 12.0; 83 const CGFloat kTextFontSize = 12.0;
84 const CGFloat kProfileButtonHeight = 30; 84 const CGFloat kProfileButtonHeight = 30;
85 const int kBezelThickness = 3; // Width of the bezel on an NSButton. 85 const int kBezelThickness = 3; // Width of the bezel on an NSButton.
86 const int kImageTitleSpacing = 10; 86 const int kImageTitleSpacing = 10;
87 const int kBlueButtonHeight = 30; 87 const int kBlueButtonHeight = 30;
88 const CGFloat kFocusRingLineWidth = 2;
89 88
90 // Fixed size for embedded sign in pages as defined in Gaia. 89 // Fixed size for embedded sign in pages as defined in Gaia.
91 const CGFloat kFixedGaiaViewWidth = 360; 90 const CGFloat kFixedGaiaViewWidth = 360;
92 const CGFloat kFixedGaiaViewHeight = 440; 91 const CGFloat kFixedGaiaViewHeight = 440;
93 92
94 // Fixed size for the account removal view. 93 // Fixed size for the account removal view.
95 const CGFloat kFixedAccountRemovalViewWidth = 280; 94 const CGFloat kFixedAccountRemovalViewWidth = 280;
96 95
97 // Fixed size for the switch user view. 96 // Fixed size for the switch user view.
98 const int kFixedSwitchUserViewWidth = 320; 97 const int kFixedSwitchUserViewWidth = 320;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 396 }
398 397
399 - (NSSize)cellSize { 398 - (NSSize)cellSize {
400 NSSize buttonSize = [super cellSize]; 399 NSSize buttonSize = [super cellSize];
401 buttonSize.width += leftMarginSpacing_; 400 buttonSize.width += leftMarginSpacing_;
402 if ([self imagePosition] == NSImageLeft) 401 if ([self imagePosition] == NSImageLeft)
403 buttonSize.width += imageTitleSpacing_; 402 buttonSize.width += imageTitleSpacing_;
404 return buttonSize; 403 return buttonSize;
405 } 404 }
406 405
407 - (NSFocusRingType)focusRingType {
408 // This is taken care of by the custom drawing code.
409 return NSFocusRingTypeNone;
410 }
411
412 - (void)drawWithFrame:(NSRect)frame inView:(NSView *)controlView {
413 [super drawInteriorWithFrame:frame inView:controlView];
414
415 // Focus ring.
416 if ([self showsFirstResponder]) {
417 NSRect focusRingRect =
418 NSInsetRect(frame, kFocusRingLineWidth, kFocusRingLineWidth);
419 // TODO(noms): When we are targetting 10.7, we should change this to use
420 // -drawFocusRingMaskWithFrame instead.
421 [[[NSColor keyboardFocusIndicatorColor] colorWithAlphaComponent:1] set];
422 NSBezierPath* path = [NSBezierPath bezierPathWithRect:focusRingRect];
423 [path setLineWidth:kFocusRingLineWidth];
424 [path stroke];
425 }
426 }
427
428 @end 406 @end
429 407
430 // A custom image view that has a transparent backround. 408 // A custom button that has a transparent backround.
431 @interface TransparentBackgroundImageView : NSImageView 409 @interface TransparentBackgroundButton : NSButton
432 @end 410 @end
433 411
434 @implementation TransparentBackgroundImageView 412 @implementation TransparentBackgroundButton
413 - (id)initWithFrame:(NSRect)frameRect {
414 if ((self = [super initWithFrame:frameRect])) {
415 [self setBordered:NO];
416 [self setFont:[NSFont labelFontOfSize:kTextFontSize]];
417 [self setButtonType:NSMomentaryChangeButton];
418 }
419 return self;
420 }
421
435 - (void)drawRect:(NSRect)dirtyRect { 422 - (void)drawRect:(NSRect)dirtyRect {
436 NSColor* backgroundColor = [NSColor colorWithCalibratedWhite:1 alpha:0.6f]; 423 NSColor* backgroundColor = [NSColor colorWithCalibratedWhite:1 alpha:0.6f];
437 [backgroundColor setFill]; 424 [backgroundColor setFill];
438 NSRectFillUsingOperation(dirtyRect, NSCompositeSourceAtop); 425 NSRectFillUsingOperation(dirtyRect, NSCompositeSourceAtop);
439 [super drawRect:dirtyRect]; 426 [super drawRect:dirtyRect];
440 } 427 }
441 @end 428 @end
442 429
443 @interface CustomCircleImageCell : NSButtonCell
444 @end
445
446 @implementation CustomCircleImageCell
447 - (void)drawWithFrame:(NSRect)frame inView:(NSView *)controlView {
448 // Display everything as a circle that spans the entire control.
449 NSBezierPath* path = [NSBezierPath bezierPathWithOvalInRect:frame];
450 [path addClip];
451
452 [super drawImage:[self image] withFrame:frame inView:controlView];
453
454 // Focus ring.
455 if ([self showsFirstResponder]) {
456 [[[NSColor keyboardFocusIndicatorColor] colorWithAlphaComponent:1] set];
457 [path setLineWidth:kFocusRingLineWidth];
458 [path stroke];
459 }
460 }
461 @end
462
463 // A custom image control that shows a "Change" button when moused over. 430 // A custom image control that shows a "Change" button when moused over.
464 @interface EditableProfilePhoto : HoverImageButton { 431 @interface EditableProfilePhoto : NSImageView {
465 @private 432 @private
466 AvatarMenu* avatarMenu_; // Weak; Owned by ProfileChooserController. 433 AvatarMenu* avatarMenu_; // Weak; Owned by ProfileChooserController.
467 base::scoped_nsobject<TransparentBackgroundImageView> changePhotoImage_; 434 base::scoped_nsobject<TransparentBackgroundButton> changePhotoButton_;
435 // Used to display the "Change" button on hover.
436 ui::ScopedCrTrackingArea trackingArea_;
468 ProfileChooserController* controller_; 437 ProfileChooserController* controller_;
469 } 438 }
470 439
471 - (id)initWithFrame:(NSRect)frameRect 440 - (id)initWithFrame:(NSRect)frameRect
472 avatarMenu:(AvatarMenu*)avatarMenu 441 avatarMenu:(AvatarMenu*)avatarMenu
473 profileIcon:(const gfx::Image&)profileIcon 442 profileIcon:(const gfx::Image&)profileIcon
474 editingAllowed:(BOOL)editingAllowed 443 editingAllowed:(BOOL)editingAllowed
475 withController:(ProfileChooserController*)controller; 444 withController:(ProfileChooserController*)controller;
476 445
477 // Called when the "Change" button is clicked. 446 // Called when the "Change" button is clicked.
478 - (void)editPhoto:(id)sender; 447 - (void)editPhoto:(id)sender;
479 448
449 // When hovering over the profile photo, show the "Change" button.
450 - (void)mouseEntered:(NSEvent*)event;
451
452 // When hovering away from the profile photo, hide the "Change" button.
453 - (void)mouseExited:(NSEvent*)event;
454 @end
455
456 @interface EditableProfilePhoto (Private)
457 // Create the "Change" avatar photo button.
458 - (TransparentBackgroundButton*)changePhotoButtonWithRect:(NSRect)rect;
480 @end 459 @end
481 460
482 @implementation EditableProfilePhoto 461 @implementation EditableProfilePhoto
483 - (id)initWithFrame:(NSRect)frameRect 462 - (id)initWithFrame:(NSRect)frameRect
484 avatarMenu:(AvatarMenu*)avatarMenu 463 avatarMenu:(AvatarMenu*)avatarMenu
485 profileIcon:(const gfx::Image&)profileIcon 464 profileIcon:(const gfx::Image&)profileIcon
486 editingAllowed:(BOOL)editingAllowed 465 editingAllowed:(BOOL)editingAllowed
487 withController:(ProfileChooserController*)controller { 466 withController:(ProfileChooserController*)controller {
488 if ((self = [super initWithFrame:frameRect])) { 467 if ((self = [super initWithFrame:frameRect])) {
489 avatarMenu_ = avatarMenu; 468 avatarMenu_ = avatarMenu;
490 controller_ = controller; 469 controller_ = controller;
470 [self setImage:CreateProfileImage(
471 profileIcon, kLargeImageSide).ToNSImage()];
491 472
492 [self setBordered:NO]; 473 // Add a tracking area so that we can show/hide the button when hovering.
493 474 trackingArea_.reset([[CrTrackingArea alloc]
494 base::scoped_nsobject<CustomCircleImageCell> cell( 475 initWithRect:[self bounds]
495 [[CustomCircleImageCell alloc] init]); 476 options:NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways
496 [self setCell:cell.get()]; 477 owner:self
497 478 userInfo:nil]);
498 [self setDefaultImage:CreateProfileImage( 479 [self addTrackingArea:trackingArea_.get()];
499 profileIcon, kLargeImageSide).ToNSImage()];
500 [self setImagePosition:NSImageOnly];
501 480
502 NSRect bounds = NSMakeRect(0, 0, kLargeImageSide, kLargeImageSide); 481 NSRect bounds = NSMakeRect(0, 0, kLargeImageSide, kLargeImageSide);
503 if (editingAllowed) { 482 if (editingAllowed) {
504 [self setTarget:self]; 483 changePhotoButton_.reset([self changePhotoButtonWithRect:bounds]);
505 [self setAction:@selector(editPhoto:)]; 484 [self addSubview:changePhotoButton_];
506 changePhotoImage_.reset([[TransparentBackgroundImageView alloc]
507 initWithFrame:bounds]);
508 [changePhotoImage_ setImage:ui::ResourceBundle::GetSharedInstance().
509 GetNativeImageNamed(IDR_ICON_PROFILES_EDIT_CAMERA).AsNSImage()];
510 [self addSubview:changePhotoImage_];
511 485
512 // Hide the image until the button is hovered over. 486 // Hide the button until the image is hovered over.
513 [changePhotoImage_ setHidden:YES]; 487 [changePhotoButton_ setHidden:YES];
514 } 488 }
515 489
516 // Set the image cell's accessibility strings to be the same as the 490 // Set the image cell's accessibility strings to be the same as the
517 // button's strings. 491 // button's strings.
518 [[self cell] accessibilitySetOverrideValue:l10n_util::GetNSString( 492 [[self cell] accessibilitySetOverrideValue:l10n_util::GetNSString(
519 editingAllowed ? 493 editingAllowed ?
520 IDS_PROFILES_NEW_AVATAR_MENU_CHANGE_PHOTO_ACCESSIBLE_NAME : 494 IDS_PROFILES_NEW_AVATAR_MENU_CHANGE_PHOTO_ACCESSIBLE_NAME :
521 IDS_PROFILES_NEW_AVATAR_MENU_PHOTO_ACCESSIBLE_NAME) 495 IDS_PROFILES_NEW_AVATAR_MENU_PHOTO_ACCESSIBLE_NAME)
522 forAttribute:NSAccessibilityTitleAttribute]; 496 forAttribute:NSAccessibilityTitleAttribute];
523 [[self cell] accessibilitySetOverrideValue: 497 [[self cell] accessibilitySetOverrideValue:
(...skipping 11 matching lines...) Expand all
535 forAttribute:NSAccessibilityTitleAttribute]; 509 forAttribute:NSAccessibilityTitleAttribute];
536 [self accessibilitySetOverrideValue:NSAccessibilityButtonRole 510 [self accessibilitySetOverrideValue:NSAccessibilityButtonRole
537 forAttribute:NSAccessibilityRoleAttribute]; 511 forAttribute:NSAccessibilityRoleAttribute];
538 [self accessibilitySetOverrideValue: 512 [self accessibilitySetOverrideValue:
539 NSAccessibilityRoleDescription(NSAccessibilityButtonRole, nil) 513 NSAccessibilityRoleDescription(NSAccessibilityButtonRole, nil)
540 forAttribute:NSAccessibilityRoleDescriptionAttribute]; 514 forAttribute:NSAccessibilityRoleDescriptionAttribute];
541 } 515 }
542 return self; 516 return self;
543 } 517 }
544 518
519 - (void)drawRect:(NSRect)dirtyRect {
520 NSRect bounds = [self bounds];
521
522 // Display the profile picture as a circle.
523 NSBezierPath* path = [NSBezierPath bezierPathWithOvalInRect:bounds];
524 [path addClip];
525 [self.image drawAtPoint:bounds.origin
526 fromRect:bounds
527 operation:NSCompositeSourceOver
528 fraction:1.0];
529
530 }
531
545 - (void)editPhoto:(id)sender { 532 - (void)editPhoto:(id)sender {
546 avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex()); 533 avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex());
547 [controller_ 534 [controller_
548 postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE]; 535 postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE];
549 } 536 }
550 537
551 - (void)setHoverState:(HoverState)state { 538 - (void)mouseEntered:(NSEvent*)event {
552 [super setHoverState:state]; 539 [changePhotoButton_ setHidden:NO];
553 [changePhotoImage_ setHidden:([self hoverState] == kHoverStateNone)]; 540 }
541
542 - (void)mouseExited:(NSEvent*)event {
543 [changePhotoButton_ setHidden:YES];
544 }
545
546 // Make sure the element is focusable for accessibility.
547 - (BOOL)canBecomeKeyView {
548 return YES;
554 } 549 }
555 550
556 - (BOOL)accessibilityIsIgnored { 551 - (BOOL)accessibilityIsIgnored {
557 return NO; 552 return NO;
558 } 553 }
559 554
560 - (NSArray*)accessibilityActionNames { 555 - (NSArray*)accessibilityActionNames {
561 NSArray* parentActions = [super accessibilityActionNames]; 556 NSArray* parentActions = [super accessibilityActionNames];
562 return [parentActions arrayByAddingObject:NSAccessibilityPressAction]; 557 return [parentActions arrayByAddingObject:NSAccessibilityPressAction];
563 } 558 }
564 559
565 - (void)accessibilityPerformAction:(NSString*)action { 560 - (void)accessibilityPerformAction:(NSString*)action {
566 if ([action isEqualToString:NSAccessibilityPressAction]) { 561 if ([action isEqualToString:NSAccessibilityPressAction]) {
567 avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex()); 562 avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex());
568 } 563 }
569 564
570 [super accessibilityPerformAction:action]; 565 [super accessibilityPerformAction:action];
571 } 566 }
572 567
568 - (TransparentBackgroundButton*)changePhotoButtonWithRect:(NSRect)rect {
569 TransparentBackgroundButton* button =
570 [[TransparentBackgroundButton alloc] initWithFrame:rect];
571 [button setImage:ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(
572 IDR_ICON_PROFILES_EDIT_CAMERA).AsNSImage()];
573 [button setImagePosition:NSImageOnly];
574 [button setTarget:self];
575 [button setAction:@selector(editPhoto:)];
576 return button;
577 }
573 @end 578 @end
574 579
575 // A custom text control that turns into a textfield for editing when clicked. 580 // A custom text control that turns into a textfield for editing when clicked.
576 @interface EditableProfileNameButton : HoverImageButton { 581 @interface EditableProfileNameButton : HoverImageButton {
577 @private 582 @private
578 base::scoped_nsobject<NSTextField> profileNameTextField_; 583 base::scoped_nsobject<NSTextField> profileNameTextField_;
579 Profile* profile_; // Weak. 584 Profile* profile_; // Weak.
580 ProfileChooserController* controller_; 585 ProfileChooserController* controller_;
581 } 586 }
582 587
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 return self; 759 return self;
755 } 760 }
756 761
757 - (void)drawRect:(NSRect)dirtyRect { 762 - (void)drawRect:(NSRect)dirtyRect {
758 [backgroundColor_ setFill]; 763 [backgroundColor_ setFill];
759 NSRectFill(dirtyRect); 764 NSRectFill(dirtyRect);
760 [super drawRect:dirtyRect]; 765 [super drawRect:dirtyRect];
761 } 766 }
762 @end 767 @end
763 768
764 // A custom dummy button that is used to clear focus from the bubble's controls.
765 @interface DummyWindowFocusButton : NSButton
766 @end
767
768 @implementation DummyWindowFocusButton
769 // Ignore accessibility, as this is a placeholder button.
770 - (BOOL)accessibilityIsIgnored {
771 return YES;
772 }
773
774 - (id)accessibilityAttributeValue:(NSString*)attribute {
775 return @[];
776 }
777
778 - (BOOL)canBecomeKeyView {
779 return false;
780 }
781
782 @end
783
784 @interface ProfileChooserController () 769 @interface ProfileChooserController ()
785 // Builds the profile chooser view. 770 // Builds the profile chooser view.
786 - (NSView*)buildProfileChooserView; 771 - (NSView*)buildProfileChooserView;
787 772
788 // Builds a tutorial card with a title label using |titleMessage|, a content 773 // Builds a tutorial card with a title label using |titleMessage|, a content
789 // label using |contentMessage|, a link using |linkMessage|, and a button using 774 // label using |contentMessage|, a link using |linkMessage|, and a button using
790 // |buttonMessage|. If |stackButton| is YES, places the button above the link. 775 // |buttonMessage|. If |stackButton| is YES, places the button above the link.
791 // Otherwise places both on the same row with the link left aligned and button 776 // Otherwise places both on the same row with the link left aligned and button
792 // right aligned. On click, the link would execute |linkAction|, and the button 777 // right aligned. On click, the link would execute |linkAction|, and the button
793 // would execute |buttonAction|. It sets |tutorialMode_| to the given |mode|. 778 // would execute |buttonAction|. It sets |tutorialMode_| to the given |mode|.
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 case profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER: 1113 case profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER:
1129 case profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT: 1114 case profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT:
1130 subView = [self buildProfileChooserView]; 1115 subView = [self buildProfileChooserView];
1131 break; 1116 break;
1132 } 1117 }
1133 1118
1134 // Clears tutorial mode for all non-profile-chooser views. 1119 // Clears tutorial mode for all non-profile-chooser views.
1135 if (viewMode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) 1120 if (viewMode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER)
1136 tutorialMode_ = profiles::TUTORIAL_MODE_NONE; 1121 tutorialMode_ = profiles::TUTORIAL_MODE_NONE;
1137 1122
1138 // Add a dummy, empty element so that we don't initially display any
1139 // focus rings.
1140 NSButton* dummyFocusButton =
1141 [[[DummyWindowFocusButton alloc] initWithFrame:NSZeroRect] autorelease];
1142 [dummyFocusButton setNextKeyView:subView];
1143 [[self window] makeFirstResponder:dummyFocusButton];
1144
1145 [contentView addSubview:subView]; 1123 [contentView addSubview:subView];
1146 [contentView addSubview:dummyFocusButton];
1147 SetWindowSize([self window], 1124 SetWindowSize([self window],
1148 NSMakeSize(NSWidth([subView frame]), NSHeight([subView frame]))); 1125 NSMakeSize(NSWidth([subView frame]), NSHeight([subView frame])));
1149 } 1126 }
1150 1127
1151 - (NSView*)buildProfileChooserView { 1128 - (NSView*)buildProfileChooserView {
1152 base::scoped_nsobject<NSView> container( 1129 base::scoped_nsobject<NSView> container(
1153 [[NSView alloc] initWithFrame:NSZeroRect]); 1130 [[NSView alloc] initWithFrame:NSZeroRect]);
1154 1131
1155 NSView* tutorialView = nil; 1132 NSView* tutorialView = nil;
1156 NSView* currentProfileView = nil; 1133 NSView* currentProfileView = nil;
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 guestItem.active = true; 1657 guestItem.active = true;
1681 guestItem.name = base::SysNSStringToUTF16( 1658 guestItem.name = base::SysNSStringToUTF16(
1682 l10n_util::GetNSString(IDS_PROFILES_GUEST_PROFILE_NAME)); 1659 l10n_util::GetNSString(IDS_PROFILES_GUEST_PROFILE_NAME));
1683 1660
1684 return [self createCurrentProfileView:guestItem]; 1661 return [self createCurrentProfileView:guestItem];
1685 } 1662 }
1686 1663
1687 - (NSButton*)createOtherProfileView:(int)itemIndex { 1664 - (NSButton*)createOtherProfileView:(int)itemIndex {
1688 const AvatarMenu::Item& item = avatarMenu_->GetItemAt(itemIndex); 1665 const AvatarMenu::Item& item = avatarMenu_->GetItemAt(itemIndex);
1689 1666
1690 NSRect rect = NSMakeRect( 1667 NSRect rect = NSMakeRect(0, 0, kFixedMenuWidth, kBlueButtonHeight);
1691 0, 0, kFixedMenuWidth, kBlueButtonHeight + kSmallVerticalSpacing);
1692 base::scoped_nsobject<BackgroundColorHoverButton> profileButton( 1668 base::scoped_nsobject<BackgroundColorHoverButton> profileButton(
1693 [[BackgroundColorHoverButton alloc] 1669 [[BackgroundColorHoverButton alloc]
1694 initWithFrame:rect 1670 initWithFrame:rect
1695 imageTitleSpacing:kImageTitleSpacing 1671 imageTitleSpacing:kImageTitleSpacing
1696 backgroundColor:GetDialogBackgroundColor()]); 1672 backgroundColor:GetDialogBackgroundColor()]);
1697 [profileButton setTitle:base::SysUTF16ToNSString(item.name)]; 1673 [profileButton setTitle:base::SysUTF16ToNSString(item.name)];
1698 [profileButton setDefaultImage:CreateProfileImage( 1674 [profileButton setDefaultImage:CreateProfileImage(
1699 item.icon, kSmallImageSide).ToNSImage()]; 1675 item.icon, kSmallImageSide).ToNSImage()];
1700 [profileButton setImagePosition:NSImageLeft]; 1676 [profileButton setImagePosition:NSImageLeft];
1701 [profileButton setAlignment:NSLeftTextAlignment]; 1677 [profileButton setAlignment:NSLeftTextAlignment];
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
2178 } 2154 }
2179 2155
2180 - (bool)shouldShowGoIncognito { 2156 - (bool)shouldShowGoIncognito {
2181 bool incognitoAvailable = 2157 bool incognitoAvailable =
2182 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 2158 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
2183 IncognitoModePrefs::DISABLED; 2159 IncognitoModePrefs::DISABLED;
2184 return incognitoAvailable && !browser_->profile()->IsGuestSession(); 2160 return incognitoAvailable && !browser_->profile()->IsGuestSession();
2185 } 2161 }
2186 2162
2187 @end 2163 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698