Commit 11abc1ad authored by James Cook's avatar James Cook Committed by Commit Bot

chromeos: Turn shortcut viewer app on by default unless a11y enabled

The app version of the shortcut viewer works well, but we're still
waiting on some accessibility support. Turn the app on by default, but
use the old version if certain a11y features are enabled.

Bug: 853883
Change-Id: I609b155da467bcb051d4d49d660de77863d0e1df
Reviewed-on: https://chromium-review.googlesource.com/1105077
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568242}
parent 9a7643de
...@@ -23,7 +23,7 @@ const base::Feature kKeyboardShortcutViewer{"KeyboardShortcutViewer", ...@@ -23,7 +23,7 @@ const base::Feature kKeyboardShortcutViewer{"KeyboardShortcutViewer",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kKeyboardShortcutViewerApp{ const base::Feature kKeyboardShortcutViewerApp{
"KeyboardShortcutViewerApp", base::FEATURE_DISABLED_BY_DEFAULT}; "KeyboardShortcutViewerApp", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kLockScreenNotifications{"LockScreenNotifications", const base::Feature kLockScreenNotifications{"LockScreenNotifications",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
......
...@@ -8,14 +8,27 @@ ...@@ -8,14 +8,27 @@
#include "ash/components/shortcut_viewer/views/keyboard_shortcut_view.h" #include "ash/components/shortcut_viewer/views/keyboard_shortcut_view.h"
#include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_features.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "content/public/common/service_manager_connection.h" #include "content/public/common/service_manager_connection.h"
#include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/connector.h"
namespace keyboard_shortcut_viewer_util { namespace keyboard_shortcut_viewer_util {
namespace {
// Keyboard shortcut viewer app is incompatible with some a11y features.
bool IsUsingA11yIncompatibleWithApp() {
chromeos::AccessibilityManager* a11y = chromeos::AccessibilityManager::Get();
return a11y->IsSpokenFeedbackEnabled() || a11y->IsCaretHighlightEnabled() ||
a11y->IsFocusHighlightEnabled() || a11y->IsSelectToSpeakEnabled() ||
a11y->IsSwitchAccessEnabled();
}
} // namespace
void ShowKeyboardShortcutViewer() { void ShowKeyboardShortcutViewer() {
base::TimeTicks user_gesture_time = base::TimeTicks::Now(); base::TimeTicks user_gesture_time = base::TimeTicks::Now();
if (ash::features::IsKeyboardShortcutViewerAppEnabled()) { if (ash::features::IsKeyboardShortcutViewerAppEnabled() &&
!IsUsingA11yIncompatibleWithApp()) {
shortcut_viewer::mojom::ShortcutViewerPtr shortcut_viewer_ptr; shortcut_viewer::mojom::ShortcutViewerPtr shortcut_viewer_ptr;
service_manager::Connector* connector = service_manager::Connector* connector =
content::ServiceManagerConnection::GetForProcess()->GetConnector(); content::ServiceManagerConnection::GetForProcess()->GetConnector();
......
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