Commit 8a688cc1 authored by Anatoliy Potapchuk's avatar Anatoliy Potapchuk Committed by Commit Bot

[Ash] Notify when floating accessibility menu moves

We want the spoken feedback user to be notified about what what happens
when the user presses the "change position" button on the floating menu.

Bug: 1061068
Change-Id: Ib1c6a70f7d94825ee057e1d7fa2406b569a84564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2199262
Commit-Queue: Anatoliy Potapchuk <apotapchuk@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768529}
parent e7c1da1d
......@@ -497,6 +497,19 @@ This file contains the strings for ash.
Floating accessibility menu
</message>
<message name="IDS_ASH_FLOATING_ACCESSIBILITY_MAIN_MENU_MOVED_TOP_LEFT" desc="Accessibility event message that is triggered when the menu is moved to the top-left corner.">
Menu moved to the top-left corner of the screen.
</message>
<message name="IDS_ASH_FLOATING_ACCESSIBILITY_MAIN_MENU_MOVED_TOP_RIGHT" desc="Accessibility event message that is triggered when the menu is moved to the top-right corner.">
Menu moved to the top-right corner of the screen.
</message>
<message name="IDS_ASH_FLOATING_ACCESSIBILITY_MAIN_MENU_MOVED_BOTTOM_LEFT" desc="Accessibility event message that is triggered when the menu is moved to the bottom-left corner.">
Menu moved to the bottom-left corner of the screen.
</message>
<message name="IDS_ASH_FLOATING_ACCESSIBILITY_MAIN_MENU_MOVED_BOTTOM_RIGHT" desc="Accessibility event message that is triggered when the menu is moved to the bottom-right corner.">
Menu moved to the bottom-right corner of the screen.
</message>
<message name="IDS_ASH_STATUS_TRAY_MIC_GAIN" desc="The accessible text for the toggle mic muted button in the tray audio settings">
Toggle Mic. <ph name="STATE_TEXT">$1<ex>Mic is muted</ex></ph>
</message>
......
......@@ -18,6 +18,7 @@
#include "ash/system/accessibility/select_to_speak_tray.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/virtual_keyboard/virtual_keyboard_tray.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/separator.h"
#include "ui/views/layout/box_layout.h"
......@@ -67,6 +68,26 @@ std::unique_ptr<views::View> CreateButtonRowContainer(int padding) {
return button_container;
}
std::string GetDescriptionForMovedToPosition(FloatingMenuPosition position) {
switch (position) {
case FloatingMenuPosition::kBottomRight:
return l10n_util::GetStringUTF8(
IDS_ASH_FLOATING_ACCESSIBILITY_MAIN_MENU_MOVED_BOTTOM_RIGHT);
case FloatingMenuPosition::kBottomLeft:
return l10n_util::GetStringUTF8(
IDS_ASH_FLOATING_ACCESSIBILITY_MAIN_MENU_MOVED_BOTTOM_LEFT);
case FloatingMenuPosition::kTopLeft:
return l10n_util::GetStringUTF8(
IDS_ASH_FLOATING_ACCESSIBILITY_MAIN_MENU_MOVED_TOP_LEFT);
case FloatingMenuPosition::kTopRight:
return l10n_util::GetStringUTF8(
IDS_ASH_FLOATING_ACCESSIBILITY_MAIN_MENU_MOVED_TOP_RIGHT);
case FloatingMenuPosition::kSystemDefault:
NOTREACHED();
return std::string();
}
}
} // namespace
FloatingAccessibilityBubbleView::FloatingAccessibilityBubbleView(
......@@ -214,6 +235,10 @@ void FloatingAccessibilityView::ButtonPressed(views::Button* sender,
}
Shell::Get()->accessibility_controller()->SetFloatingMenuPosition(
new_position);
Shell::Get()
->accessibility_controller()
->TriggerAccessibilityAlertWithMessage(
GetDescriptionForMovedToPosition(new_position));
}
return;
}
......
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