Skip to content

Commit

Permalink
[Tutorials, a11y] Prompt 'focus inactive bubble' accelerator on ChromeOS
Browse files Browse the repository at this point in the history
Because not all chromebooks have function keys, the ALT+SHIFT+A
accelerator (which has the same function with help bubbles) is a better
choice to prompt screen reader users to use.

Because the text of the accelerator message is auto-generated from the
accelerator name, no l10n changes are needed to update the prompt.

(cherry picked from commit 73c279c)

Bug: 1316670
Change-Id: Ia909fb1bd3db5802fff47d2988ccabe329678aa8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3588733
Auto-Submit: Dana Fried <dfried@chromium.org>
Reviewed-by: David Pennington <dpenning@chromium.org>
Commit-Queue: David Pennington <dpenning@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#993350}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3600201
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Dana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/branch-heads/5005@{#84}
Cr-Branched-From: 5b4d945-refs/heads/main@{#992738}
  • Loading branch information
Dana Fried authored and Chromium LUCI CQ committed Apr 21, 2022
1 parent 4a8568b commit 9774f15
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -6,6 +6,7 @@

#include <string>

#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/user_education/help_bubble_factory_views.h"
Expand Down Expand Up @@ -93,7 +94,15 @@ std::u16string BrowserFeaturePromoController::GetTutorialScreenReaderHint()
const {
ui::Accelerator accelerator;
std::u16string accelerator_text;
if (browser_view_->GetAccelerator(IDC_FOCUS_NEXT_PANE, &accelerator)) {
#if BUILDFLAG(IS_CHROMEOS)
// IDC_FOCUS_NEXT_PANE still reports as F6 on ChromeOS, but many ChromeOS
// devices do not have function keys. Therefore, instead prompt the other
// accelerator that does the same thing.
static const auto kAccelerator = IDC_FOCUS_INACTIVE_POPUP_FOR_ACCESSIBILITY;
#else
static const auto kAccelerator = IDC_FOCUS_NEXT_PANE;
#endif
if (browser_view_->GetAccelerator(kAccelerator, &accelerator)) {
accelerator_text = accelerator.GetShortcutText();
} else {
NOTREACHED();
Expand Down

0 comments on commit 9774f15

Please sign in to comment.