Commit f6a4eae0 authored by Nancy Wang's avatar Nancy Wang Committed by Commit Bot

Implement the pause/block app accessbility requirement for Chrome Vox.

If the app is paused or blocked, announce 'Paused' or 'Blocked' for
Chrome Vox, when the icon item is selected/focused from app list, shelf
or searchbox.

The block status has higher priority. When the app is paused and
blocked, announce 'Blocked'.

This CL modifies the search box result to add 'Paused' or 'Blocked' to
the accessible name.

BUG=1144384

Change-Id: I1388a021a169cf332b86bfd892d7ccde990fc805
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2545908
Commit-Queue: Nancy Wang <nancylingwang@google.com>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828768}
parent cff1a62c
...@@ -3185,6 +3185,13 @@ Here are some things you can try to get started. ...@@ -3185,6 +3185,13 @@ Here are some things you can try to get started.
<message name="IDS_ASH_MULTIPASTE_CONTEXTUAL_NUDGE_SEARCH_KEY" desc="The name of the first key to be used for the keyboard shortcut for activating multipaste, when the device has a search key."> <message name="IDS_ASH_MULTIPASTE_CONTEXTUAL_NUDGE_SEARCH_KEY" desc="The name of the first key to be used for the keyboard shortcut for activating multipaste, when the device has a search key.">
Search Search
</message> </message>
<message name="IDS_APP_ACCESSIBILITY_BLOCKED_INSTALLED_APP_ANNOUNCEMENT" desc="Accessibility text to specify a search result is a blocked installed app.">
<ph name="APP_NAME">$1<ex>Files</ex></ph>, Installed App, Blocked
</message>
<message name="IDS_APP_ACCESSIBILITY_PAUSED_INSTALLED_APP_ANNOUNCEMENT" desc="Accessibility text to specify a search result is an paused installed app.">
<ph name="APP_NAME">$1<ex>Files</ex></ph>, Installed App, Paused
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
83d6f0f7d267e821a36601384e4680ebb2603533
\ No newline at end of file
456a3b0cd11d7f059925b95db7c4a1f8ed0d7b4a
\ No newline at end of file
...@@ -7,8 +7,10 @@ ...@@ -7,8 +7,10 @@
#include "ash/public/cpp/app_list/app_list_config.h" #include "ash/public/cpp/app_list/app_list_config.h"
#include "ash/public/cpp/app_list/app_list_types.h" #include "ash/public/cpp/app_list/app_list_types.h"
#include "ash/public/cpp/app_list/internal_app_id_constants.h" #include "ash/public/cpp/app_list/internal_app_id_constants.h"
#include "ash/strings/grit/ash_strings.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/apps/app_service/app_service_metrics.h" #include "chrome/browser/apps/app_service/app_service_metrics.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
...@@ -28,6 +30,7 @@ ...@@ -28,6 +30,7 @@
#include "components/services/app_service/public/cpp/app_update.h" #include "components/services/app_service/public/cpp/app_update.h"
#include "components/services/app_service/public/mojom/types.mojom.h" #include "components/services/app_service/public/mojom/types.mojom.h"
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
#include "ui/base/l10n/l10n_util.h"
namespace app_list { namespace app_list {
...@@ -51,6 +54,16 @@ AppServiceAppResult::AppServiceAppResult(Profile* profile, ...@@ -51,6 +54,16 @@ AppServiceAppResult::AppServiceAppResult(Profile* profile,
update.IsPlatformApp() == apps::mojom::OptionalBool::kTrue; update.IsPlatformApp() == apps::mojom::OptionalBool::kTrue;
show_in_launcher_ = show_in_launcher_ =
update.ShowInLauncher() == apps::mojom::OptionalBool::kTrue; update.ShowInLauncher() == apps::mojom::OptionalBool::kTrue;
if (update.Readiness() == apps::mojom::Readiness::kDisabledByPolicy) {
SetAccessibleName(l10n_util::GetStringFUTF16(
IDS_APP_ACCESSIBILITY_BLOCKED_INSTALLED_APP_ANNOUNCEMENT,
base::UTF8ToUTF16(update.ShortName())));
} else if (update.Paused() == apps::mojom::OptionalBool::kTrue) {
SetAccessibleName(l10n_util::GetStringFUTF16(
IDS_APP_ACCESSIBILITY_PAUSED_INSTALLED_APP_ANNOUNCEMENT,
base::UTF8ToUTF16(update.ShortName())));
}
}); });
constexpr bool allow_placeholder_icon = true; constexpr bool allow_placeholder_icon = true;
......
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