Commit 83ccf172 authored by Jason Lin's avatar Jason Lin Committed by Chromium LUCI CQ

VmCameraMicManager uses "Chrome OS" as notification source

Bug: b/167491603
Change-Id: I8682f941ba8a3cd282991f62c73dffedf91e3030
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2598094
Commit-Queue: Jason Lin <lxj@google.com>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Auto-Submit: Jason Lin <lxj@google.com>
Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#838620}
parent 492288dd
......@@ -5405,6 +5405,9 @@
<message name="IDS_CAMERA_MIC_NOTIFICATION_SOURCE" desc="The name of the source of a 'camera and mic' notification">
Camera &amp; microphone
</message>
<message name="IDS_CHROME_OS_NOTIFICATION_SOURCE" desc="The name of the source of a Chrome OS notificatoin">
Chrome OS
</message>
<message name="IDS_APP_USING_CAMERA_NOTIFICATION_MESSAGE" desc="Message shown in notification when an app is using the camera">
<ph name="APP_NAME">$1<ex>Parallels Desktop</ex></ph> is using your camera
</message>
......
234e0982d252ad24116e6de2905ab9eab7274c07
\ No newline at end of file
......@@ -256,24 +256,18 @@ void VmCameraMicManager::OpenNotification(VmType vm, NotificationType type) {
return;
}
const char* notifier_id = ash::kVmCameraMicNotifierId;
const gfx::VectorIcon* source_icon = nullptr;
int source_id;
int message_id;
if (type[static_cast<size_t>(DeviceType::kCamera)]) {
source_icon = &::vector_icons::kVideocamIcon;
if (type[static_cast<size_t>(DeviceType::kMic)]) {
source_id = IDS_CAMERA_MIC_NOTIFICATION_SOURCE;
message_id = IDS_APP_USING_CAMERA_MIC_NOTIFICATION_MESSAGE;
} else {
source_id = IDS_CAMERA_NOTIFICATION_SOURCE;
message_id = IDS_APP_USING_CAMERA_NOTIFICATION_MESSAGE;
}
} else {
DCHECK_EQ(type, kMicNotification);
source_icon = &::vector_icons::kMicIcon;
source_id = IDS_MIC_NOTIFICATION_SOURCE;
message_id = IDS_APP_USING_MIC_NOTIFICATION_MESSAGE;
}
......@@ -303,10 +297,11 @@ void VmCameraMicManager::OpenNotification(VmType vm, NotificationType type) {
l10n_util::GetStringUTF16(app_name_id)),
/*message=*/base::string16(),
/*icon=*/gfx::Image(),
/*display_source=*/l10n_util::GetStringUTF16(source_id),
/*display_source=*/
l10n_util::GetStringUTF16(IDS_CHROME_OS_NOTIFICATION_SOURCE),
/*origin_url=*/GURL(),
message_center::NotifierId(message_center::NotifierType::SYSTEM_COMPONENT,
notifier_id),
ash::kVmCameraMicNotifierId),
rich_notification_data,
base::MakeRefCounted<message_center::ThunkNotificationDelegate>(
std::move(notification_observer_)));
......
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