Commit 68a6cf62 authored by Amr Aboelkher's avatar Amr Aboelkher Committed by Commit Bot

Change the notification for accessibility features hotkeys

Add the organisation name instead of Administrator to the message.

Bug: 552439
Change-Id: I763e3fa3a2438350a17a64028f33dc5c9ba2167c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850431Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Amr Aboelkher <amraboelkher@google.com>
Cr-Commit-Position: refs/heads/master@{#705305}
parent c061882d
......@@ -51,6 +51,8 @@
#include "ash/system/brightness_control_delegate.h"
#include "ash/system/ime_menu/ime_menu_tray.h"
#include "ash/system/keyboard_brightness_control_delegate.h"
#include "ash/system/model/enterprise_domain_model.h"
#include "ash/system/model/system_tray_model.h"
#include "ash/system/palette/palette_tray.h"
#include "ash/system/palette/palette_utils.h"
#include "ash/system/power/power_button_controller.h"
......@@ -1007,12 +1009,22 @@ void CreateAndShowStickyNotification(
void NotifyAccessibilityFeatureDisabledByAdmin(
int feature_name_id,
bool feature_state,
const std::string& notification_id) {
const base::string16 organization_name =
base::UTF8ToUTF16(Shell::Get()
->system_tray_model()
->enterprise_domain()
->enterprise_display_domain());
CreateAndShowStickyNotification(
l10n_util::GetStringUTF16(
IDS_ASH_ACCESSIBILITY_FEATURE_SHORTCUT_DISABLED_TITLE),
l10n_util::GetStringFUTF16(
IDS_ASH_ACCESSIBILITY_FEATURE_SHORTCUT_DISABLED_MSG,
organization_name,
l10n_util::GetStringUTF16(
feature_state ? IDS_ASH_ACCESSIBILITY_FEATURE_ACTIVATED
: IDS_ASH_ACCESSIBILITY_FEATURE_DEACTIVATED),
l10n_util::GetStringUTF16(feature_name_id)),
notification_id, kLoginScreenEnterpriseIcon);
}
......@@ -1035,7 +1047,7 @@ void SetDockedMagnifierEnabled(bool enabled) {
kDockedMagnifierToggleAccelNotificationId);
} else if (enabled != actual_enabled) {
NotifyAccessibilityFeatureDisabledByAdmin(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_DOCKED_MAGNIFIER,
IDS_ASH_DOCKED_MAGNIFIER_SHORTCUT_DISABLED, actual_enabled,
kDockedMagnifierToggleAccelNotificationId);
}
}
......@@ -1083,7 +1095,7 @@ void SetFullscreenMagnifierEnabled(bool enabled) {
kFullscreenMagnifierToggleAccelNotificationId);
} else if (enabled != actual_enabled) {
NotifyAccessibilityFeatureDisabledByAdmin(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SCREEN_MAGNIFIER,
IDS_ASH_FULLSCREEN_MAGNIFIER_SHORTCUT_DISABLED, actual_enabled,
kFullscreenMagnifierToggleAccelNotificationId);
}
}
......@@ -1102,7 +1114,7 @@ void SetHighContrastEnabled(bool enabled) {
kHighContrastToggleAccelNotificationId);
} else if (enabled != actual_enabled) {
NotifyAccessibilityFeatureDisabledByAdmin(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGH_CONTRAST_MODE,
IDS_ASH_HIGH_CONTRAST_SHORTCUT_DISABLED, actual_enabled,
kHighContrastToggleAccelNotificationId);
}
}
......@@ -1167,7 +1179,8 @@ void HandleToggleSpokenFeedback() {
RemoveStickyNotitification(kSpokenFeedbackToggleAccelNotificationId);
if (!controller->spoken_feedback_enabled() && !old_value) {
NotifyAccessibilityFeatureDisabledByAdmin(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SPOKEN_FEEDBACK,
IDS_ASH_SPOKEN_FEEDBACK_SHORTCUT_DISABLED,
controller->spoken_feedback_enabled(),
kSpokenFeedbackToggleAccelNotificationId);
}
}
......
......@@ -416,7 +416,31 @@ This file contains the strings for ash.
</message>
<message name="IDS_ASH_ACCESSIBILITY_FEATURE_SHORTCUT_DISABLED_MSG"
desc="The message used to indicate that, the corresponding shortcut for that accessibility feature has been disabled.">
Administrator has deactivated <ph name="FEATURE_NAME">$1<ex>Fullscreen magnifier</ex></ph>.
<ph name="ORGANIZATION_NAME">$1<ex>google.com</ex></ph> has <ph name="FEATURE_STATE">$2<ex>activated</ex></ph> <ph name="FEATURE_NAME">$3<ex>Fullscreen magnifier</ex></ph>.
</message>
<message name="IDS_ASH_HIGH_CONTRAST_SHORTCUT_DISABLED"
desc="The label used in the notification used to indicate that, the shortcut for high contrast feature has been disabled.">
high-contrast mode
</message>
<message name="IDS_ASH_DOCKED_MAGNIFIER_SHORTCUT_DISABLED"
desc="The label used in the notification used to indicate that, the shortcut for docked magnifier feature has been disabled.">
the docked magnifier
</message>
<message name="IDS_ASH_FULLSCREEN_MAGNIFIER_SHORTCUT_DISABLED"
desc="The label used in the notification used to indicate that, the shortcut for fullscreen magnifier feature has been disabled.">
the full-screen magnifier
</message>
<message name="IDS_ASH_SPOKEN_FEEDBACK_SHORTCUT_DISABLED"
desc="The label used in the notification used to indicate that, the shortcut for spoken feedback feature has been disabled.">
ChromeVox (spoken feedback)
</message>
<message name="IDS_ASH_ACCESSIBILITY_FEATURE_ACTIVATED"
desc="The label used in the notification used to indicate that, the accessibility feature is being set as forced enabled.">
activated
</message>
<message name="IDS_ASH_ACCESSIBILITY_FEATURE_DEACTIVATED"
desc="The label used in the notification used to indicate that, the accessibility feature is being set as forced disabled.">
deactivated
</message>
<message name="IDS_ASH_STATUS_TRAY_IME_SHORT" desc="The short label used for IME button in system tray bubble.">
......
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