0

[Color correction] Adds color correction to a11y quick settings

Adds color correction toggle to accessibility quick settings
menu unless there is no logged in user. The first time
color correction is enabled, the os://settings page for
color correction will be opened.

Screenshot: screenshot/5zyWR6KHFKTgCNN
Design: go/cros-color-filtering

Bug:b/259372272
AX-Relnotes:N/A
Test:New


[Color correction] Updates color correction settings per mocks

This change removes unused color correction settings that will
not be part of the final feature, and updates the color
correction part of os://settings to match the mocks.

Color correction is behind a flag while it is being developed,
so removing these prefs shouldn't cause any issues as they were
only available with the flag.

Screenshots:
Light mode: screenshot/9gbAZJ92WzvEYEy, screenshot/7Vm6BfFVQioifqz,
Dark mode: screenshot/5QDuRnQ834wSQ38

AX-Relnotes: N/A
Bug: b/259372272
Change-Id: Ia5b34b14717efb5c792d692505ac85a7c3efc53b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4606062
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Katie Dektar <katie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1157113}
This commit is contained in:
Katie Dektar
2023-06-13 19:25:09 +00:00
committed by Chromium LUCI CQ
parent 0ba3af8450
commit b9b3365855
21 changed files with 399 additions and 8 deletions

@ -29,6 +29,7 @@ enum class A11yFeatureType {
kStickyKeys,
kSwitchAccess,
kVirtualKeyboard,
kColorCorrection,
kFeatureCount,

@ -34,6 +34,7 @@
#include "ash/public/cpp/notification_utils.h"
#include "ash/public/cpp/session/session_observer.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/system_tray_client.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller_impl.h"
@ -45,6 +46,7 @@
#include "ash/system/accessibility/floating_accessibility_controller.h"
#include "ash/system/accessibility/select_to_speak/select_to_speak_menu_bubble_controller.h"
#include "ash/system/accessibility/switch_access/switch_access_menu_bubble_controller.h"
#include "ash/system/model/system_tray_model.h"
#include "ash/system/power/backlights_forced_off_setter.h"
#include "ash/system/power/power_status.h"
#include "ash/system/power/scoped_backlights_forced_off.h"
@ -109,6 +111,8 @@ const FeatureData kFeatures[] = {
nullptr},
{FeatureType::kDictation, prefs::kAccessibilityDictationEnabled,
&kDictationMenuIcon},
{FeatureType::kColorCorrection, prefs::kAccessibilityColorFiltering,
&kColorCorrectionIcon},
{FeatureType::kFocusHighlight, prefs::kAccessibilityFocusHighlightEnabled,
nullptr, /* conflicting_feature= */ FeatureType::kSpokenFeedback},
{FeatureType::kFloatingMenu, prefs::kAccessibilityFloatingMenuEnabled,
@ -198,6 +202,7 @@ constexpr const char* const kCopiedOnSigninAccessibilityPrefs[]{
prefs::kAccessibilityChromeVoxVirtualBrailleColumns,
prefs::kAccessibilityChromeVoxVirtualBrailleRows,
prefs::kAccessibilityChromeVoxVoiceName,
prefs::kAccessibilityColorFiltering,
prefs::kAccessibilityCursorHighlightEnabled,
prefs::kAccessibilityCursorColorEnabled,
prefs::kAccessibilityCursorColor,
@ -807,6 +812,12 @@ void AccessibilityControllerImpl::Feature::UpdateFromPref() {
PrefService* prefs = owner_->active_user_prefs_;
DCHECK(prefs);
if (pref_name_ == prefs::kAccessibilityColorFiltering &&
!::features::
AreExperimentalAccessibilityColorEnhancementSettingsEnabled()) {
return;
}
bool enabled = prefs->GetBoolean(pref_name_);
if (conflicting_feature_ != FeatureType::kNoConflictingFeature &&
@ -1024,6 +1035,8 @@ void AccessibilityControllerImpl::RegisterProfilePrefs(
if (::features::
AreExperimentalAccessibilityColorEnhancementSettingsEnabled()) {
registry->RegisterBooleanPref(prefs::kAccessibilityColorFiltering, false);
registry->RegisterBooleanPref(
prefs::kAccessibilityColorFilteringHasBeenSetup, false);
}
// TODO(b/266816160): Make ChromeVox prefs are syncable, to so that ChromeOS
@ -1293,6 +1306,11 @@ AccessibilityControllerImpl::Feature& AccessibilityControllerImpl::dictation()
return GetFeature(FeatureType::kDictation);
}
AccessibilityControllerImpl::Feature&
AccessibilityControllerImpl::color_correction() const {
return GetFeature(FeatureType::kColorCorrection);
}
AccessibilityControllerImpl::Feature&
AccessibilityControllerImpl::focus_highlight() const {
return GetFeature(FeatureType::kFocusHighlight);
@ -1373,6 +1391,7 @@ bool AccessibilityControllerImpl::IsPrimarySettingsViewVisibleInTray() {
return (IsSpokenFeedbackSettingVisibleInTray() ||
IsSelectToSpeakSettingVisibleInTray() ||
IsDictationSettingVisibleInTray() ||
IsColorCorrectionSettingVisibleInTray() ||
IsHighContrastSettingVisibleInTray() ||
IsFullScreenMagnifierSettingVisibleInTray() ||
IsDockedMagnifierSettingVisibleInTray() ||
@ -1453,6 +1472,25 @@ bool AccessibilityControllerImpl::IsEnterpriseIconVisibleForHighContrast() {
return high_contrast().IsEnterpriseIconVisible();
}
bool AccessibilityControllerImpl::IsColorCorrectionSettingVisibleInTray() {
if (!::features::
AreExperimentalAccessibilityColorEnhancementSettingsEnabled()) {
return false;
}
if (!color_correction().enabled() &&
Shell::Get()->session_controller()->login_status() ==
ash::LoginStatus::NOT_LOGGED_IN) {
// Don't allow users to enable this on not logged in profiles because it
// requires set-up in settings the first time it is run.
return false;
}
return color_correction().IsVisibleInTray();
}
bool AccessibilityControllerImpl::IsEnterpriseIconVisibleForColorCorrection() {
return color_correction().IsEnterpriseIconVisible();
}
bool AccessibilityControllerImpl::IsLargeCursorSettingVisibleInTray() {
return large_cursor().IsVisibleInTray();
}
@ -2023,11 +2061,6 @@ void AccessibilityControllerImpl::ObservePrefs(PrefService* prefs) {
&AccessibilityControllerImpl::UpdateCursorColorFromPrefs,
base::Unretained(this)));
if (color_enhancement_feature_enabled) {
pref_change_registrar_->Add(
prefs::kAccessibilityColorFiltering,
base::BindRepeating(
&AccessibilityControllerImpl::UpdateColorFilteringFromPrefs,
base::Unretained(this)));
pref_change_registrar_->Add(
prefs::kAccessibilityColorVisionCorrectionAmount,
base::BindRepeating(
@ -2698,6 +2731,18 @@ void AccessibilityControllerImpl::UpdateFeatureFromPref(FeatureType feature) {
case FeatureType::kCursorColor:
UpdateCursorColorFromPrefs();
break;
case FeatureType::kColorCorrection:
if (enabled && !active_user_prefs_->GetBoolean(
prefs::kAccessibilityColorFilteringHasBeenSetup)) {
Shell::Get()
->system_tray_model()
->client()
->ShowColorCorrectionSettings();
active_user_prefs_->SetBoolean(
prefs::kAccessibilityColorFilteringHasBeenSetup, true);
}
UpdateColorFilteringFromPrefs();
break;
case FeatureType::kFeatureCount:
case FeatureType::kNoConflictingFeature:
NOTREACHED();

@ -210,6 +210,7 @@ class ASH_EXPORT AccessibilityControllerImpl : public AccessibilityController,
Feature& caret_highlight() const;
Feature& cursor_highlight() const;
Feature& dictation() const;
Feature& color_correction() const;
Feature& floating_menu() const;
Feature& focus_highlight() const;
FeatureWithDialog& fullscreen_magnifier() const;
@ -275,6 +276,9 @@ class ASH_EXPORT AccessibilityControllerImpl : public AccessibilityController,
bool IsHighContrastSettingVisibleInTray();
bool IsEnterpriseIconVisibleForHighContrast();
bool IsColorCorrectionSettingVisibleInTray();
bool IsEnterpriseIconVisibleForColorCorrection();
bool IsLargeCursorSettingVisibleInTray();
bool IsEnterpriseIconVisibleForLargeCursor();

@ -16,6 +16,7 @@
#include "ash/constants/ash_pref_names.h"
#include "ash/display/cursor_window_controller.h"
#include "ash/keyboard/ui/keyboard_util.h"
#include "ash/public/cpp/test/test_system_tray_client.h"
#include "ash/session/session_controller_impl.h"
#include "ash/session/test_pref_service_provider.h"
#include "ash/shell.h"
@ -179,6 +180,8 @@ TEST_F(AccessibilityControllerTest, PrefsAreRegistered) {
if (::features::
AreExperimentalAccessibilityColorEnhancementSettingsEnabled()) {
EXPECT_TRUE(prefs->FindPreference(prefs::kAccessibilityColorFiltering));
EXPECT_TRUE(
prefs->FindPreference(prefs::kAccessibilityColorFilteringHasBeenSetup));
EXPECT_TRUE(
prefs->FindPreference(prefs::kAccessibilityColorVisionDeficiencyType));
EXPECT_TRUE(prefs->FindPreference(
@ -226,6 +229,42 @@ TEST_F(AccessibilityControllerTest, SetCaretHighlightEnabled) {
controller->RemoveObserver(&observer);
}
TEST_F(AccessibilityControllerTest, SetColorCorrectionEnabled) {
AccessibilityControllerImpl* controller =
Shell::Get()->accessibility_controller();
EXPECT_FALSE(controller->color_correction().enabled());
TestAccessibilityObserver observer;
controller->AddObserver(&observer);
EXPECT_EQ(0, observer.status_changed_count_);
EXPECT_EQ(0, GetSystemTrayClient()->show_color_correction_settings_count());
controller->color_correction().SetEnabled(true);
EXPECT_TRUE(controller->color_correction().enabled());
EXPECT_EQ(1, observer.status_changed_count_);
// The first time we should show the settings for color correction.
EXPECT_EQ(1, GetSystemTrayClient()->show_color_correction_settings_count());
controller->color_correction().SetEnabled(false);
EXPECT_FALSE(controller->color_correction().enabled());
EXPECT_EQ(2, observer.status_changed_count_);
controller->color_correction().SetEnabled(true);
EXPECT_TRUE(controller->color_correction().enabled());
EXPECT_EQ(3, observer.status_changed_count_);
// The second time, the settings window should not be opened.
EXPECT_EQ(1, GetSystemTrayClient()->show_color_correction_settings_count());
controller->color_correction().SetEnabled(false);
EXPECT_FALSE(controller->color_correction().enabled());
EXPECT_EQ(4, observer.status_changed_count_);
controller->RemoveObserver(&observer);
}
TEST_F(AccessibilityControllerTest, SetCursorHighlightEnabled) {
AccessibilityControllerImpl* controller =
Shell::Get()->accessibility_controller();

@ -1080,6 +1080,9 @@ Style notes:
<message name="IDS_ASH_STATUS_TRAY_ACCESSIBILITY_DICTATION" desc="The label used in the accessibility menu of the system tray to toggle on/off the speak to type feature.">
Dictation
</message>
<message name="IDS_ASH_STATUS_TRAY_ACCESSIBILITY_COLOR_CORRECTION" desc="The label used in the accessibility menu of the system tray to toggle on/off the color correction feature.">
Color correction
</message>
<message name="IDS_ASH_DICTATION_LANGUAGE_SUPPORTED_OFFLINE_NUDGE" desc="The message shown for existing Dictation users when their Dictation language has been upgraded in the background to work offline.">
<ph name="language">$1<ex>English</ex></ph> speech is now processed locally and works offline. You can change your Dictation language in Settings > Accessibility.
</message>

@ -0,0 +1 @@
d19925dbfff558c4de7473b27d7b393dd3b05306

@ -431,6 +431,10 @@ const char kAccessibilityAutoclickMenuPosition[] =
// Whether to enable color filtering settings.
const char kAccessibilityColorFiltering[] =
"settings.a11y.color_filtering.enabled";
// Whether color filtering has been set up yet. It should be set up on first
// use.
const char kAccessibilityColorFilteringHasBeenSetup[] =
"settings.a11y.color_filtering.setup";
// The amount of a color vision correction filter to apply.
const char kAccessibilityColorVisionCorrectionAmount[] =
"settings.a11y.color_filtering.color_vision_correction_amount";

@ -212,6 +212,8 @@ extern const char kAccessibilityAutoclickMenuPosition[];
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const char kAccessibilityColorFiltering[];
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const char kAccessibilityColorFilteringHasBeenSetup[];
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const char kAccessibilityColorVisionCorrectionAmount[];
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const char kAccessibilityColorVisionDeficiencyType[];

@ -95,6 +95,9 @@ class ASH_PUBLIC_EXPORT SystemTrayClient {
// Shows the settings related to accessibility.
virtual void ShowAccessibilitySettings() = 0;
// Shows the settings related to color correction.
virtual void ShowColorCorrectionSettings() = 0;
// Shows gesture education help.
virtual void ShowGestureEducationHelp() = 0;

@ -60,6 +60,10 @@ void TestSystemTrayClient::ShowAccessibilityHelp() {}
void TestSystemTrayClient::ShowAccessibilitySettings() {}
void TestSystemTrayClient::ShowColorCorrectionSettings() {
show_color_correction_settings_count_++;
}
void TestSystemTrayClient::ShowGestureEducationHelp() {}
void TestSystemTrayClient::ShowPaletteHelp() {}

@ -44,6 +44,7 @@ class ASH_PUBLIC_EXPORT TestSystemTrayClient : public SystemTrayClient {
void ShowAboutChromeOSDetails() override;
void ShowAccessibilityHelp() override;
void ShowAccessibilitySettings() override;
void ShowColorCorrectionSettings() override;
void ShowGestureEducationHelp() override;
void ShowPaletteHelp() override;
void ShowPaletteSettings() override;
@ -177,6 +178,10 @@ class ASH_PUBLIC_EXPORT TestSystemTrayClient : public SystemTrayClient {
int show_eol_info_count() const { return show_eol_info_count_; }
int show_color_correction_settings_count() const {
return show_color_correction_settings_count_;
}
private:
int show_network_settings_count_ = 0;
int show_bluetooth_settings_count_ = 0;
@ -207,6 +212,7 @@ class ASH_PUBLIC_EXPORT TestSystemTrayClient : public SystemTrayClient {
int show_audio_settings_count_ = 0;
bool user_feedback_enabled_ = false;
int show_eol_info_count_ = 0;
int show_color_correction_settings_count_ = 0;
};
} // namespace ash

@ -84,6 +84,7 @@ aggregate_vector_icons("ash_vector_icons") {
"clipboard_launcher.icon",
"clipboard_launcher_no_assistant.icon",
"clipboard_search.icon",
"color_correction.icon",
"combine_desks.icon",
"continue_files_dark.icon",
"continue_files_light.icon",

@ -0,0 +1,39 @@
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 14,
MOVE_TO, 0, 14,
R_V_LINE_TO, -4,
R_LINE_TO, 7, -7,
R_LINE_TO, -1, -1,
R_LINE_TO, 1, -1,
R_LINE_TO, 2, 2,
R_LINE_TO, 2, -3,
R_H_LINE_TO, 1,
R_LINE_TO, 2, 2,
R_V_LINE_TO, 1,
R_LINE_TO, -2, 3,
R_LINE_TO, 1, 1,
R_LINE_TO, -1, 1,
R_LINE_TO, -1, -1,
R_LINE_TO, -7, 7,
H_LINE_TO, 0,
CLOSE,
R_MOVE_TO, 2, -1,
R_H_LINE_TO, 1,
R_LINE_TO, 7, -7,
R_LINE_TO, -2, -2,
R_LINE_TO, -6, 7,
R_V_LINE_TO, 2,
CLOSE,
R_MOVE_TO, 8, -8,
R_LINE_TO, 2, -2,
R_LINE_TO, -1, -1,
R_LINE_TO, -1, 2,
R_V_LINE_TO, 1,
CLOSE,
R_MOVE_TO, 0, 0,
V_LINE_TO, 4,
R_V_LINE_TO, 1,
CLOSE

@ -191,6 +191,16 @@ void AccessibilityDetailedView::OnAccessibilityStatusChanged() {
UpdateFeatureState(checked, dictation_view_, dictation_top_view_);
}
if (controller->IsColorCorrectionSettingVisibleInTray()) {
if (!::features::
AreExperimentalAccessibilityColorEnhancementSettingsEnabled()) {
return;
}
bool checked = controller->color_correction().enabled();
UpdateFeatureState(checked, color_correction_view_,
color_correction_top_view_);
}
if (controller->IsHighContrastSettingVisibleInTray()) {
bool checked = controller->high_contrast().enabled();
UpdateFeatureState(checked, high_contrast_view_, high_contrast_top_view_);
@ -305,6 +315,10 @@ void AccessibilityDetailedView::AddEnabledFeatures(views::View* container) {
controller->dictation().enabled()) {
dictation_top_view_ = AddDictationView(container);
}
if (controller->IsColorCorrectionSettingVisibleInTray() &&
controller->color_correction().enabled()) {
color_correction_top_view_ = AddColorCorrectionView(container);
}
if (controller->IsHighContrastSettingVisibleInTray() &&
controller->high_contrast().enabled()) {
high_contrast_top_view_ = AddHighContrastView(container);
@ -376,6 +390,10 @@ void AccessibilityDetailedView::AddAllFeatures(views::View* container) {
dictation_view_ = AddDictationView(container);
}
if (controller->IsColorCorrectionSettingVisibleInTray()) {
color_correction_view_ = AddColorCorrectionView(container);
}
if (controller->IsHighContrastSettingVisibleInTray()) {
high_contrast_view_ = AddHighContrastView(container);
}
@ -477,6 +495,17 @@ HoverHighlightView* AccessibilityDetailedView::AddDictationView(
checked, controller->IsEnterpriseIconVisibleForDictation());
}
HoverHighlightView* AccessibilityDetailedView::AddColorCorrectionView(
views::View* container) {
auto* controller = Shell::Get()->accessibility_controller();
bool checked = controller->color_correction().enabled();
return AddScrollListFeatureItem(
container, kColorCorrectionIcon,
l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_COLOR_CORRECTION),
checked, controller->IsEnterpriseIconVisibleForColorCorrection());
}
HoverHighlightView* AccessibilityDetailedView::AddHighContrastView(
views::View* container) {
auto* controller = Shell::Get()->accessibility_controller();
@ -712,6 +741,14 @@ void AccessibilityDetailedView::HandleViewClicked(views::View* view) {
RecordAction(new_state ? UserMetricsAction("StatusArea_DictationEnabled")
: UserMetricsAction("StatusArea_DictationDisabled"));
controller->dictation().SetEnabled(new_state);
} else if ((view == color_correction_view_ ||
view == color_correction_top_view_) &&
!controller->IsEnterpriseIconVisibleForColorCorrection()) {
bool new_state = !controller->color_correction().enabled();
RecordAction(new_state
? UserMetricsAction("StatusArea_ColorCorrectionEnabled")
: UserMetricsAction("StatusArea_ColorCorrectionDisabled"));
controller->color_correction().SetEnabled(new_state);
} else if ((view == high_contrast_top_view_ || view == high_contrast_view_) &&
!controller->IsEnterpriseIconVisibleForHighContrast()) {
bool new_state = !controller->high_contrast().enabled();

@ -11,6 +11,7 @@
#include "ash/accessibility/accessibility_observer.h"
#include "ash/public/cpp/session/session_observer.h"
#include "ash/system/tray/tray_detailed_view.h"
#include "base/allocator/partition_allocator/pointers/raw_ptr.h"
#include "base/memory/raw_ptr.h"
#include "components/soda/soda_installer.h"
#include "ui/gfx/font.h"
@ -83,6 +84,7 @@ class ASH_EXPORT AccessibilityDetailedView
HoverHighlightView* AddSpokenFeedbackView(views::View* container);
HoverHighlightView* AddSelectToSpeakView(views::View* container);
HoverHighlightView* AddDictationView(views::View* container);
HoverHighlightView* AddColorCorrectionView(views::View* container);
HoverHighlightView* AddHighContrastView(views::View* container);
HoverHighlightView* AddScreenMagnifierView(views::View* container);
HoverHighlightView* AddDockedMagnifierView(views::View* container);
@ -131,6 +133,7 @@ class ASH_EXPORT AccessibilityDetailedView
raw_ptr<HoverHighlightView, ExperimentalAsh> spoken_feedback_view_ = nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> select_to_speak_view_ = nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> dictation_view_ = nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> color_correction_view_ = nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> high_contrast_view_ = nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> screen_magnifier_view_ = nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> docked_magnifier_view_ = nullptr;
@ -155,6 +158,8 @@ class ASH_EXPORT AccessibilityDetailedView
raw_ptr<HoverHighlightView, ExperimentalAsh> select_to_speak_top_view_ =
nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> dictation_top_view_ = nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> color_correction_top_view_ =
nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> high_contrast_top_view_ =
nullptr;
raw_ptr<HoverHighlightView, ExperimentalAsh> screen_magnifier_top_view_ =

@ -24,6 +24,7 @@
#include "components/prefs/pref_service.h"
#include "components/soda/soda_installer_impl_chromeos.h"
#include "media/base/media_switches.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/ax_enums.mojom-shared.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/views/controls/label.h"
@ -112,6 +113,11 @@ void EnableSwitchAccess(bool enabled) {
Shell::Get()->accessibility_controller()->switch_access().SetEnabled(enabled);
}
void EnableColorCorrection(bool enabled) {
Shell::Get()->accessibility_controller()->color_correction().SetEnabled(
enabled);
}
speech::LanguageCode en_us() {
return speech::LanguageCode::kEnUs;
}
@ -144,7 +150,8 @@ class AccessibilityDetailedViewTest : public AshTestBase,
AccessibilityDetailedViewTest() {
scoped_feature_list_.InitWithFeatures(
{media::kLiveCaption, media::kLiveCaptionSystemWideOnChromeOS,
ash::features::kOnDeviceSpeechRecognition},
ash::features::kOnDeviceSpeechRecognition,
::features::kExperimentalAccessibilityColorEnhancementSettings},
{});
}
AccessibilityDetailedViewTest(const AccessibilityDetailedViewTest&) = delete;
@ -253,6 +260,10 @@ class AccessibilityDetailedViewTest : public AshTestBase,
ClickView(detailed_menu_->dictation_view_);
}
void ClickColorCorrectionOnDetailMenu() {
ClickView(detailed_menu_->color_correction_view_);
}
bool IsSpokenFeedbackMenuShownOnDetailMenu() const {
return detailed_menu_->spoken_feedback_view_;
}
@ -317,6 +328,10 @@ class AccessibilityDetailedViewTest : public AshTestBase,
return detailed_menu_->switch_access_view_;
}
bool IsColorCorrectionShownOnDetailMenu() const {
return detailed_menu_->color_correction_view_;
}
// In material design we show the help button but theme it as disabled if
// it is not possible to load the help page.
bool IsHelpAvailableOnDetailMenu() {
@ -434,6 +449,11 @@ class AccessibilityDetailedViewTest : public AshTestBase,
detailed_menu_->switch_access_view_);
}
bool IsColorCorrectionEnabledOnDetailMenu() const {
return IsEnabledOnDetailMenu(controller_->color_correction().enabled(),
detailed_menu_->color_correction_view_);
}
const char* GetDetailedViewClassName() {
return detailed_menu_->GetClassName();
}
@ -491,6 +511,9 @@ class AccessibilityDetailedViewTest : public AshTestBase,
views::View* switch_access_view() const {
return detailed_menu_->switch_access_view_;
}
views::View* color_correction_view() const {
return detailed_menu_->color_correction_view_;
}
// Accessors for the top views listing enabled items.
HoverHighlightView* spoken_feedback_top_view() const {
@ -541,6 +564,9 @@ class AccessibilityDetailedViewTest : public AshTestBase,
HoverHighlightView* switch_access_top_view() const {
return detailed_menu_->switch_access_top_view_;
}
HoverHighlightView* color_correction_top_view() const {
return detailed_menu_->color_correction_top_view_;
}
private:
// AccessibilityObserver:
@ -592,6 +618,7 @@ TEST_F(AccessibilityDetailedViewQsRevampTest, ListItemsAreInRoundedContainer) {
EXPECT_TRUE(has_rounded_container_parent(highlight_keyboard_focus_view()));
EXPECT_TRUE(has_rounded_container_parent(sticky_keys_view()));
EXPECT_TRUE(has_rounded_container_parent(switch_access_view()));
EXPECT_TRUE(has_rounded_container_parent(color_correction_view()));
CloseDetailMenu();
}
@ -632,6 +659,7 @@ TEST_F(AccessibilityDetailedViewQsRevampTest,
EXPECT_FALSE(highlight_keyboard_focus_top_view());
EXPECT_FALSE(sticky_keys_top_view());
EXPECT_FALSE(switch_access_top_view());
EXPECT_FALSE(color_correction_top_view());
}
// Verifies that pressing the tab key moves from row to row. In particular,
@ -645,6 +673,8 @@ TEST_F(AccessibilityDetailedViewQsRevampTest, TabMovesFocusBetweenRows) {
PressAndReleaseKey(ui::VKEY_TAB);
EXPECT_TRUE(dictation_view()->HasFocus());
PressAndReleaseKey(ui::VKEY_TAB);
EXPECT_TRUE(color_correction_view()->HasFocus());
PressAndReleaseKey(ui::VKEY_TAB);
EXPECT_TRUE(high_contrast_view()->HasFocus());
PressAndReleaseKey(ui::VKEY_TAB);
EXPECT_TRUE(screen_magnifier_view()->HasFocus());
@ -888,6 +918,19 @@ TEST_F(AccessibilityDetailedViewQsRevampTest, SwitchAccessTopView) {
EXPECT_FALSE(controller()->switch_access().enabled());
}
TEST_F(AccessibilityDetailedViewQsRevampTest, ColorCorrectionTopView) {
EnableColorCorrection(true);
CreateDetailedMenu();
ASSERT_TRUE(color_correction_top_view());
EXPECT_TRUE(IsSwitchToggled(color_correction_top_view()));
EXPECT_TRUE(IsCheckedForAccessibility(color_correction_top_view()));
ClickView(color_correction_top_view());
EXPECT_FALSE(IsSwitchToggled(color_correction_top_view()));
EXPECT_FALSE(IsCheckedForAccessibility(color_correction_top_view()));
EXPECT_FALSE(controller()->color_correction().enabled());
}
TEST_F(AccessibilityDetailedViewTest, CheckMenuVisibilityOnDetailMenu) {
// Except help & settings, others should be kept the same
// in LOGIN | NOT LOGIN | LOCKED. https://crbug.com/632107.
@ -910,6 +953,7 @@ TEST_F(AccessibilityDetailedViewTest, CheckMenuVisibilityOnDetailMenu) {
EXPECT_TRUE(IsHighlightKeyboardFocusMenuShownOnDetailMenu());
EXPECT_TRUE(IsStickyKeysMenuShownOnDetailMenu());
EXPECT_TRUE(IsSwitchAccessShownOnDetailMenu());
EXPECT_TRUE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Simulate screen lock.
@ -933,6 +977,7 @@ TEST_F(AccessibilityDetailedViewTest, CheckMenuVisibilityOnDetailMenu) {
EXPECT_TRUE(IsHighlightKeyboardFocusMenuShownOnDetailMenu());
EXPECT_TRUE(IsStickyKeysMenuShownOnDetailMenu());
EXPECT_TRUE(IsSwitchAccessShownOnDetailMenu());
EXPECT_TRUE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
UnblockUserSession();
@ -957,6 +1002,7 @@ TEST_F(AccessibilityDetailedViewTest, CheckMenuVisibilityOnDetailMenu) {
EXPECT_TRUE(IsHighlightKeyboardFocusMenuShownOnDetailMenu());
EXPECT_TRUE(IsStickyKeysMenuShownOnDetailMenu());
EXPECT_TRUE(IsSwitchAccessShownOnDetailMenu());
EXPECT_TRUE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
UnblockUserSession();
}
@ -1139,6 +1185,17 @@ TEST_F(AccessibilityDetailedViewTest, ClickDetailMenu) {
CreateDetailedMenu();
ClickDictationOnDetailMenu();
EXPECT_FALSE(accessibility_controller->dictation().enabled());
// Confirms that the check item toggles color correction.
EXPECT_FALSE(accessibility_controller->color_correction().enabled());
CreateDetailedMenu();
ClickColorCorrectionOnDetailMenu();
EXPECT_TRUE(accessibility_controller->color_correction().enabled());
CreateDetailedMenu();
ClickColorCorrectionOnDetailMenu();
EXPECT_FALSE(accessibility_controller->color_correction().enabled());
}
// Trivial test to increase code coverage.
@ -1334,6 +1391,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, NothingCheckedByDefault) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1359,6 +1418,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, SpokenFeedback) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling spoken feedback.
@ -1382,6 +1443,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, SpokenFeedback) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1431,6 +1494,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, SelectToSpeak) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling select to speak.
@ -1454,6 +1519,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, SelectToSpeak) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1479,6 +1546,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, Dictation) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling dictation.
@ -1502,6 +1571,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, Dictation) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1527,6 +1598,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, HighContrast) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling high contrast.
@ -1550,6 +1623,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, HighContrast) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1575,6 +1650,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, FullScreenMagnifier) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling screen magnifier.
@ -1598,6 +1675,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, FullScreenMagnifier) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1623,6 +1702,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, DockedMagnifier) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling docked magnifier.
@ -1646,6 +1727,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, DockedMagnifier) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1671,6 +1754,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, LargeCursor) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling large cursor.
@ -1694,6 +1779,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, LargeCursor) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1719,6 +1806,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, LiveCaption) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling Live Caption.
@ -1742,6 +1831,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, LiveCaption) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1767,6 +1858,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, VirtualKeyboard) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disable on-screen keyboard.
@ -1790,6 +1883,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, VirtualKeyboard) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1815,6 +1910,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, MonoAudio) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling mono audio.
@ -1838,6 +1935,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, MonoAudio) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1863,6 +1962,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, CaretHighlight) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling caret highlight.
@ -1886,6 +1987,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, CaretHighlight) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1911,6 +2014,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, CursorHighlight) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling highlight mouse cursor.
@ -1934,6 +2039,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, CursorHighlight) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -1959,6 +2066,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, FocusHighlight) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling highlight keyboard focus.
@ -1982,6 +2091,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, FocusHighlight) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -2007,6 +2118,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, StickyKeys) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling sticky keys.
@ -2030,6 +2143,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, StickyKeys) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -2156,6 +2271,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, AllFeatures) {
// Switch Access is currently cannot be enabled from the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
@ -2181,6 +2298,8 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, Autoclick) {
// Switch Access is currently not available on the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
// Disabling autoclick.
@ -2204,6 +2323,33 @@ TEST_F(AccessibilityDetailedViewLoginScreenTest, Autoclick) {
// Switch Access is currently not available on the login screen.
// TODO(crbug.com/1108808): Uncomment once issue is addressed.
// EXPECT_FALSE(IsSwitchAccessEnabledOnDetailMenu());
// Color correction cannot be enabled from the login screen.
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
CloseDetailMenu();
}
class AccessibilityDetailedViewWithoutColorCorrectionTest
: public AccessibilityDetailedViewTest {
public:
AccessibilityDetailedViewWithoutColorCorrectionTest() {
feature_list_.InitAndDisableFeature(
::features::kExperimentalAccessibilityColorEnhancementSettings);
}
AccessibilityDetailedViewWithoutColorCorrectionTest(
const AccessibilityDetailedViewWithoutColorCorrectionTest&) = delete;
AccessibilityDetailedViewWithoutColorCorrectionTest& operator=(
const AccessibilityDetailedViewWithoutColorCorrectionTest&) = delete;
~AccessibilityDetailedViewWithoutColorCorrectionTest() override = default;
private:
base::test::ScopedFeatureList feature_list_;
};
TEST_F(AccessibilityDetailedViewWithoutColorCorrectionTest,
NoColorCorrectionIfFlagNotSet) {
CreateDetailedMenu();
EXPECT_FALSE(IsColorCorrectionShownOnDetailMenu());
EXPECT_FALSE(color_correction_top_view());
CloseDetailMenu();
}

@ -563,6 +563,11 @@ bool AccessibilityManager::ShouldShowAccessibilityMenu() {
prefs->GetBoolean(prefs::kDockedMagnifierEnabled)) {
return true;
}
if (::features::
AreExperimentalAccessibilityColorEnhancementSettingsEnabled() &&
prefs->GetBoolean(prefs::kAccessibilityColorFiltering)) {
return true;
}
}
return false;
}

@ -217,6 +217,15 @@ bool IsMonoAudioEnabled() {
return AccessibilityManager::Get()->IsMonoAudioEnabled();
}
bool IsColorCorrectionEnabled() {
return GetActiveUserPrefs()->GetBoolean(prefs::kAccessibilityColorFiltering);
}
void SetColorCorrectionEnabled(bool enabled) {
GetActiveUserPrefs()->SetBoolean(prefs::kAccessibilityColorFiltering,
enabled);
}
void SetSelectToSpeakEnabled(bool enabled) {
AccessibilityManager::Get()->SetSelectToSpeakEnabled(enabled);
}
@ -433,7 +442,9 @@ class AccessibilityManagerTest : public MixinBasedInProcessBrowserTest {
void SetUpCommandLine(base::CommandLine* command_line) override {
scoped_feature_list_.InitWithFeatures(
{features::kOnDeviceSpeechRecognition}, {});
{features::kOnDeviceSpeechRecognition,
::features::kExperimentalAccessibilityColorEnhancementSettings},
{});
MixinBasedInProcessBrowserTest::SetUpCommandLine(command_line);
}
@ -772,9 +783,10 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, AccessibilityMenuVisibility) {
EXPECT_FALSE(IsSpokenFeedbackEnabled());
EXPECT_FALSE(IsHighContrastEnabled());
EXPECT_FALSE(IsAutoclickEnabled());
EXPECT_FALSE(ShouldShowAccessibilityMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabled());
EXPECT_FALSE(IsMonoAudioEnabled());
EXPECT_FALSE(IsColorCorrectionEnabled());
EXPECT_FALSE(ShouldShowAccessibilityMenu());
EXPECT_FALSE(ShouldShowAccessibilityMenu());
SetAlwaysShowMenuEnabledPref(true);
@ -821,6 +833,11 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, AccessibilityMenuVisibility) {
EXPECT_TRUE(ShouldShowAccessibilityMenu());
SetSelectToSpeakEnabled(false);
EXPECT_FALSE(ShouldShowAccessibilityMenu());
SetColorCorrectionEnabled(true);
EXPECT_TRUE(ShouldShowAccessibilityMenu());
SetColorCorrectionEnabled(false);
EXPECT_FALSE(ShouldShowAccessibilityMenu());
}
IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest,

@ -520,6 +520,16 @@ void SystemTrayClientImpl::ShowAccessibilitySettings() {
: chromeos::settings::mojom::kAccessibilitySectionPath);
}
void SystemTrayClientImpl::ShowColorCorrectionSettings() {
if (user_manager::UserManager::Get()->IsLoggedInAsAnyKioskApp()) {
// TODO(b/259370808): Color correction settings subpage not available in
// Kiosk.
return;
}
ShowSettingsSubPageForActiveUser(
chromeos::settings::mojom::kDisplayAndMagnificationSubpagePath);
}
void SystemTrayClientImpl::ShowGestureEducationHelp() {
base::RecordAction(base::UserMetricsAction("ShowGestureEducationHelp"));
Profile* profile = ProfileManager::GetActiveUserProfile();

@ -83,6 +83,7 @@ class SystemTrayClientImpl : public ash::SystemTrayClient,
void ShowAboutChromeOSDetails() override;
void ShowAccessibilityHelp() override;
void ShowAccessibilitySettings() override;
void ShowColorCorrectionSettings() override;
void ShowGestureEducationHelp() override;
void ShowPaletteHelp() override;
void ShowPaletteSettings() override;

@ -34106,6 +34106,24 @@ should be able to be added at any place in this file.
</description>
</action>
<action name="StatusArea_ColorCorrectionDisabled">
<owner>katie@chromium.org</owner>
<owner>ash/accessibility/OWNERS</owner>
<description>
Counts the number of times the user has turned off color correction settings
from the system tray.
</description>
</action>
<action name="StatusArea_ColorCorrectionEnabled">
<owner>katie@chromium.org</owner>
<owner>ash/accessibility/OWNERS</owner>
<description>
Counts the number of times the user has turned on color correction settings
from the system tray.
</description>
</action>
<action name="StatusArea_DictationDisabled">
<owner>anastasi@google.com</owner>
<description>Ash system menu: Accessibility: Disable Dictation.</description>