0

QS: Update the name of QuietModeFeaturePod

With the OsSettingsAppBadgeToggle feature enabled,
this "notification" pod becomes Do Not Disturb.
Also - all settings have moved from QS to the OS Settings page.

https://screenshot.googleplex.com/BXd8qTisri8mU9r.png
https://screenshot.googleplex.com/4DntTTAad95f2E3.png

Bug: b:269639617
Change-Id: I1f69da6bc8cd00ea56182ae2212ee0bb4f7ac228
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4345591
Reviewed-by: Andre Le <leandre@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1119515}
This commit is contained in:
Alex Newcomer
2023-03-20 19:14:26 +00:00
committed by Chromium LUCI CQ
parent d13c310c49
commit a26e9d1bb4
5 changed files with 50 additions and 11 deletions

@ -1320,6 +1320,15 @@ Style notes:
</message>
<message name="IDS_ASH_STATUS_TRAY_NOTIFICATIONS_DO_NOT_DISTURB_SUBLABEL" desc="The sub label text shown under do not disturb button when all notifications are disabled. [CHAR_LIMIT=14]">
Do not disturb
</message>
<message name="IDS_ASH_STATUS_TRAY_NOTIFICATIONS_SETTINGS_DO_NOT_DISTURB_TOGGLE_TOOLTIP" desc="The tooltip text of the button that shows notification settings. Used when all notifications are disabled.">
Do not disturb is on
</message>
<message name="IDS_ASH_STATUS_TRAY_NOTIFICATIONS_DO_NOT_DISTURB_ON_SUBLABEL" desc="The sub label text shown under the do not disturb button when notifications are disabled (do not disturb is on). [CHAR_LIMIT=14]">
On
</message>
<message name="IDS_ASH_STATUS_TRAY_NOTIFICATIONS_DO_NOT_DISTURB_OFF_SUBLABEL" desc="The sub label text shown under do not disturb button when notifications are enabled (do not disturb is off). [CHAR_LIMIT=14]">
Off
</message>
<message name="IDS_ASH_STATUS_TRAY_LOCALE" desc="The label used for locale button in system tray bubble. [CHAR_LIMIT=14]">
Language

@ -0,0 +1 @@
9e7fe39469a1af5e4c2b8e8c3299c06bbe9e30a4

@ -0,0 +1 @@
5e7758f64d253097947ff75408cbae16782dde80

@ -0,0 +1 @@
76b77f8a8167782e7695de95c4e9808461e60334

@ -41,11 +41,15 @@ QuietModeFeaturePodController::QuietModeFeaturePodController(
UnifiedSystemTrayController* tray_controller)
: tray_controller_(tray_controller) {
MessageCenter::Get()->AddObserver(this);
NotifierSettingsController::Get()->AddNotifierSettingsObserver(this);
if (!features::IsOsSettingsAppBadgingToggleEnabled()) {
NotifierSettingsController::Get()->AddNotifierSettingsObserver(this);
}
}
QuietModeFeaturePodController::~QuietModeFeaturePodController() {
NotifierSettingsController::Get()->RemoveNotifierSettingsObserver(this);
if (!features::IsOsSettingsAppBadgingToggleEnabled()) {
NotifierSettingsController::Get()->RemoveNotifierSettingsObserver(this);
}
MessageCenter::Get()->RemoveObserver(this);
}
@ -66,12 +70,19 @@ FeaturePodButton* QuietModeFeaturePodController::CreateButton() {
TrackVisibilityUMA();
}
button_->SetLabel(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NOTIFICATIONS_LABEL));
button_->SetIconTooltip(l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_NOTIFICATIONS_TOGGLE_TOOLTIP,
GetQuietModeStateTooltip()));
button_->ShowDetailedViewArrow();
if (features::IsOsSettingsAppBadgingToggleEnabled()) {
button_->SetLabel(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DO_NOT_DISTURB));
} else {
button_->SetLabel(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NOTIFICATIONS_LABEL));
button_->ShowDetailedViewArrow();
}
OnQuietModeChanged(MessageCenter::Get()->IsQuietMode());
return button_;
}
@ -155,13 +166,29 @@ void QuietModeFeaturePodController::OnQuietModeChanged(bool in_quiet_mode) {
GetQuietModeStateTooltip()));
if (in_quiet_mode) {
button_->SetSubLabel(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_NOTIFICATIONS_DO_NOT_DISTURB_SUBLABEL));
button_->SetLabelTooltip(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_NOTIFICATIONS_SETTINGS_DO_NOT_DISTURB_TOOLTIP));
} else if (button_->GetVisible()) {
NotifierSettingsController::Get()->GetNotifiers();
const int sublabel_string_id =
features::IsOsSettingsAppBadgingToggleEnabled()
? IDS_ASH_STATUS_TRAY_NOTIFICATIONS_DO_NOT_DISTURB_ON_SUBLABEL
: IDS_ASH_STATUS_TRAY_NOTIFICATIONS_DO_NOT_DISTURB_SUBLABEL;
const int tooltip_string_id =
features::IsOsSettingsAppBadgingToggleEnabled()
? IDS_ASH_STATUS_TRAY_NOTIFICATIONS_SETTINGS_DO_NOT_DISTURB_TOGGLE_TOOLTIP
: IDS_ASH_STATUS_TRAY_NOTIFICATIONS_SETTINGS_DO_NOT_DISTURB_TOOLTIP;
button_->SetSubLabel(l10n_util::GetStringUTF16(sublabel_string_id));
button_->SetLabelTooltip(l10n_util::GetStringUTF16(tooltip_string_id));
return;
}
if (button_->GetVisible() &&
!features::IsOsSettingsAppBadgingToggleEnabled()) {
NotifierSettingsController::Get()->GetNotifiers();
return;
}
button_->SetSubLabel(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_NOTIFICATIONS_DO_NOT_DISTURB_OFF_SUBLABEL));
button_->SetLabelTooltip(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_NOTIFICATIONS_DO_NOT_DISTURB_OFF_STATE));
}
void QuietModeFeaturePodController::OnNotifiersUpdated(