0

Add tooltip for HPS system tray icon

Uploaded image can be viewed at:
https://storage.cloud.google.com/chromium-translation-screenshots/7674d16f0c0cee57fb4fd6747f60bfa2f36dabf6

Bug: 1299655
Change-Id: I9be3529d244246bf9a5467827ef425bad7bed07b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3499580
Reviewed-by: Michael Martis <martis@chromium.org>
Reviewed-by: Ahmed Mehfooz <amehfooz@chromium.org>
Commit-Queue: Thanh Nguyen <thanhdng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#980384}
This commit is contained in:
Thanh Nguyen
2022-03-13 22:58:04 +00:00
committed by Chromium LUCI CQ
parent 44b86c998d
commit e3be522c45
3 changed files with 9 additions and 0 deletions

@ -4892,6 +4892,10 @@ New install
Privacy settings
</message>
<message name="IDS_ASH_SMART_PRIVACY_SNOOPING_NOTIFICATION_SYSTEM_TRAY_TOOLTIP_TEXT" desc="Tooltip text explaining the smart privacy icon at the system tray.">
Someone is looking at your screen
</message>
<!-- USB-C cable notifications - version 2 -->
<message name="IDS_ASH_USB_NOTIFICATION_V2_LEARN_MORE" desc="Notification button text. If the user clicks on it, it will send them to a relevant webpage.">
Learn More

@ -0,0 +1 @@
7674d16f0c0cee57fb4fd6747f60bfa2f36dabf6

@ -8,12 +8,14 @@
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/session/session_controller_impl.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_utils.h"
#include "base/logging.h"
#include "components/session_manager/session_manager_types.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/vector_icon_types.h"
@ -33,6 +35,8 @@ HpsNotifyView::HpsNotifyView(Shelf* shelf) : TrayItemView(shelf) {
SetVisible(controller->SnooperPresent());
UpdateIconColor(session_controller->GetSessionState());
image_view()->SetTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_SMART_PRIVACY_SNOOPING_NOTIFICATION_SYSTEM_TRAY_TOOLTIP_TEXT));
}
HpsNotifyView::~HpsNotifyView() = default;