Commit b28b0d99 authored by Tatsuhisa Yamaguchi's avatar Tatsuhisa Yamaguchi Committed by Commit Bot

Show tooltip of a button only when text is truncated.

Tooltip is not needed for the "sign in another user..." button because
it's same as the label itself. The default behavior of the label can add
tooltip with the label text only when the label is truncated.

Test: manual
Bug: 866439
Change-Id: I4dee9ea44b751d64f07b0458311a653bffb0a283
Reviewed-on: https://chromium-review.googlesource.com/1152644Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tatsuhisa Yamaguchi <yamaguchi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579343}
parent 2d9e7ee4
......@@ -203,6 +203,8 @@ AddUserButton::AddUserButton(UnifiedSystemTrayController* controller)
auto* icon = new views::ImageView;
icon->SetImage(
gfx::CreateVectorIcon(kSystemMenuNewUserIcon, kUnifiedMenuIconColor));
icon->SetTooltipText(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT));
AddChildView(icon);
auto* label = new views::Label(
......@@ -212,7 +214,7 @@ AddUserButton::AddUserButton(UnifiedSystemTrayController* controller)
label->SetSubpixelRenderingEnabled(false);
AddChildView(label);
SetTooltipText(
SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT));
SetFocusPainter(TrayPopupUtils::CreateFocusPainter());
SetFocusForPlatform();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment