Commit ab9d3399 authored by Finnur Thorarinsson's avatar Finnur Thorarinsson Committed by Commit Bot

Windows Native Notifications: UMA for settings.

Notifications can be disabled for a number of
reasons. This logs those reasons with UMA.

This is a retry of my earlier CL, but does
not abort if getting settings failed (not
a fatal failure anyway).

Bug: 734095
Change-Id: I9a04f666e8181d87fd945fcdcac0c3a0371aa2f0
Reviewed-on: https://chromium-review.googlesource.com/995536Reviewed-by: default avatarXi Cheng <chengx@chromium.org>
Commit-Queue: Finnur Thorarinsson <finnur@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548287}
parent 6d037d9d
......@@ -300,6 +300,30 @@ class NotificationPlatformBridgeWinImpl
return;
}
winui::Notifications::NotificationSetting setting;
if (SUCCEEDED(notifier_->get_Setting(&setting))) {
switch (setting) {
case winui::Notifications::NotificationSetting_Enabled:
break;
case winui::Notifications::NotificationSetting_DisabledForApplication:
LogDisplayHistogram(DisplayStatus::DISABLED_FOR_APPLICATION);
DLOG(ERROR) << "Notification disabled for application";
return;
case winui::Notifications::NotificationSetting_DisabledForUser:
LogDisplayHistogram(DisplayStatus::DISABLED_FOR_USER);
DLOG(ERROR) << "Notification disabled for user";
return;
case winui::Notifications::NotificationSetting_DisabledByGroupPolicy:
LogDisplayHistogram(DisplayStatus::DISABLED_BY_GROUP_POLICY);
DLOG(ERROR) << "Notification disabled by group policy";
return;
case winui::Notifications::NotificationSetting_DisabledByManifest:
LogDisplayHistogram(DisplayStatus::DISABLED_BY_MANIFEST);
DLOG(ERROR) << "Notification disabled by manifest";
return;
}
}
NotificationLaunchId launch_id(notification_type, notification->id(),
profile_id, incognito,
notification->origin_url());
......
......@@ -28,6 +28,10 @@ enum class DisplayStatus {
SHOWING_TOAST_FAILED = 15,
CREATE_TOAST_NOTIFICATION_MANAGER_FAILED = 16,
CREATE_TOAST_NOTIFIER_WITH_ID_FAILED = 17,
DISABLED_FOR_APPLICATION = 18,
DISABLED_FOR_USER = 19,
DISABLED_BY_GROUP_POLICY = 20,
DISABLED_BY_MANIFEST = 21,
COUNT // Must be the final value.
};
......
......@@ -47132,6 +47132,10 @@ Full version information for the fingerprint enum values:
<int value="15" label="SHOWING_TOAST_FAILED"/>
<int value="16" label="CREATE_TOAST_NOTIFICATION_MANAGER_FAILED"/>
<int value="17" label="CREATE_TOAST_NOTIFIER_WITH_ID_FAILED"/>
<int value="18" label="DISABLED_FOR_APPLICATION"/>
<int value="19" label="DISABLED_FOR_USER"/>
<int value="20" label="DISABLED_BY_GROUP_POLICY"/>
<int value="21" label="DISABLED_BY_MANIFEST"/>
</enum>
<enum name="WindowsNotificationGetDisplayedLaunchIdStatus">
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