- // Adds the "end preview and relaunch" button at the bottom.
- base::scoped_nsobject<NSButton> endPreviewAndRelaunchButton(
- [[BlueLabelButton alloc] initWithFrame:NSZeroRect]);
- [endPreviewAndRelaunchButton setTitle:l10n_util::GetNSString(
- IDS_PROFILES_END_PREVIEW_AND_RELAUNCH)];
- [endPreviewAndRelaunchButton setTarget:self];
- [endPreviewAndRelaunchButton setAction:@selector(endPreviewAndRelaunch:)];
- [endPreviewAndRelaunchButton sizeToFit];
- [endPreviewAndRelaunchButton setAlignment:NSCenterTextAlignment];
- CGFloat xOffset = (kFixedEndPreviewViewWidth -
- NSWidth([endPreviewAndRelaunchButton frame])) / 2;
- [endPreviewAndRelaunchButton setFrameOrigin:NSMakePoint(xOffset, yOffset)];
- [container addSubview:endPreviewAndRelaunchButton];
- yOffset = NSMaxY([endPreviewAndRelaunchButton frame]) + kVerticalSpacing;
-
- // Adds the main text label.
- NSPoint contentFrameOrigin = NSMakePoint(kHorizontalSpacing, yOffset);
- NSString* contentStr =
- l10n_util::GetNSString(IDS_PROFILES_END_PREVIEW_TEXT);
- NSTextField* contentLabel = BuildLabel(contentStr, contentFrameOrigin,
- GetDialogBackgroundColor(), nil /* text_color */);
+ const AvatarMenu::Item& avatarItem =
+ avatarMenu_->GetItemAt(avatarMenu_->GetActiveProfileIndex());
+
+ // Adds "Disconnect your Google Account" button at the bottom.
+ NSButton* disconnectButton =
+ [self hoverButtonWithRect:viewRect
+ text:l10n_util::GetNSString(
+ IDS_PROFILES_DISCONNECT_BUTTON)
+ imageResourceId:IDR_ICON_PROFILES_MENU_DISCONNECT
+ action:@selector(disconnectProfile:)];
+ [container addSubview:disconnectButton];
+ yOffset = NSMaxY([disconnectButton frame]);
+
+ NSBox* separator = [self horizontalSeparatorWithFrame:
+ NSMakeRect(0, yOffset, kFixedMenuWidth, 0)];
+ [container addSubview:separator];
+ yOffset = NSMaxY([separator frame]);
+
+ // Adds "Add person" button.
+ viewRect.origin.y = yOffset;
+ NSButton* addPersonButton =
+ [self hoverButtonWithRect:viewRect
+ text:l10n_util::GetNSString(
+ IDS_PROFILES_ADD_PERSON_BUTTON)
+ imageResourceId:IDR_ICON_PROFILES_MENU_AVATAR
+ action:@selector(showUserManager:)];
+ [container addSubview:addPersonButton];
+ yOffset = NSMaxY([addPersonButton frame]);
+
+ separator = [self horizontalSeparatorWithFrame:
+ NSMakeRect(0, yOffset, kFixedMenuWidth, 0)];
+ [container addSubview:separator];
+ yOffset = NSMaxY([separator frame]);
+
+ // Adds the content text.
+ base::string16 elidedName(gfx::ElideText(
+ avatarItem.name, gfx::FontList(), availableWidth, gfx::ELIDE_TAIL));
+ NSTextField* contentLabel = BuildLabel(
+ l10n_util::GetNSStringF(IDS_PROFILES_NOT_YOU_CONTENT_TEXT, elidedName),
+ NSMakePoint(kHorizontalSpacing, yOffset + kVerticalSpacing),
+ nil);