Commit f4b3d5e6 authored by Hiroki Sato's avatar Hiroki Sato Committed by Commit Bot

Add chrome.accessibilityFeatures.cursorColor implementation

CL:2261179 added a definition of this API, but there was no
implementation for it.
This CL adds it.

Bug: 1127721
Test: browser_test AccessibilityFeaturesApiTest
Change-Id: I131406370e6e81599286bb02b5dd3e0dd6761aef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2407937
Commit-Queue: Hiroki Sato <hirokisato@chromium.org>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811488}
parent b2c2f1bb
...@@ -188,6 +188,7 @@ IN_PROC_BROWSER_TEST_P(AccessibilityFeaturesApiTest, Get) { ...@@ -188,6 +188,7 @@ IN_PROC_BROWSER_TEST_P(AccessibilityFeaturesApiTest, Get) {
// WARNING: Make sure that features which load Chrome extension are not among // WARNING: Make sure that features which load Chrome extension are not among
// enabled_features (see |Set| test for the reason). // enabled_features (see |Set| test for the reason).
std::vector<std::string> enabled_features = { std::vector<std::string> enabled_features = {
"cursorColor",
"cursorHighlight", "cursorHighlight",
"highContrast", "highContrast",
"largeCursor", "largeCursor",
...@@ -241,6 +242,7 @@ IN_PROC_BROWSER_TEST_P(AccessibilityFeaturesApiTest, Get_ComponentApp) { ...@@ -241,6 +242,7 @@ IN_PROC_BROWSER_TEST_P(AccessibilityFeaturesApiTest, Get_ComponentApp) {
std::vector<std::string> disabled_features = { std::vector<std::string> disabled_features = {
"autoclick", "autoclick",
"caretHighlight", "caretHighlight",
"cursorColor",
"focusHighlight", "focusHighlight",
"screenMagnifier", "screenMagnifier",
"selectToSpeak", "selectToSpeak",
...@@ -275,6 +277,7 @@ IN_PROC_BROWSER_TEST_P(AccessibilityFeaturesApiTest, Set) { ...@@ -275,6 +277,7 @@ IN_PROC_BROWSER_TEST_P(AccessibilityFeaturesApiTest, Set) {
// would induce loading of Chrome extension. // would induce loading of Chrome extension.
std::vector<std::string> enabled_features = { std::vector<std::string> enabled_features = {
"caretHighlight", "caretHighlight",
"cursorColor",
"focusHighlight", "focusHighlight",
"stickyKeys", "stickyKeys",
}; };
...@@ -319,6 +322,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityFeaturesApiTest, ObserveFeatures) { ...@@ -319,6 +322,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityFeaturesApiTest, ObserveFeatures) {
// enabled_features (see |Set| test for the reason). // enabled_features (see |Set| test for the reason).
std::vector<std::string> enabled_features = { std::vector<std::string> enabled_features = {
"caretHighlight", "caretHighlight",
"cursorColor",
"dockedMagnifier", "dockedMagnifier",
"focusHighlight", "focusHighlight",
"stickyKeys", "stickyKeys",
......
...@@ -153,6 +153,9 @@ const PrefMappingEntry kPrefMapping[] = { ...@@ -153,6 +153,9 @@ const PrefMappingEntry kPrefMapping[] = {
{"caretHighlight", ash::prefs::kAccessibilityCaretHighlightEnabled, {"caretHighlight", ash::prefs::kAccessibilityCaretHighlightEnabled,
APIPermission::kAccessibilityFeaturesRead, APIPermission::kAccessibilityFeaturesRead,
APIPermission::kAccessibilityFeaturesModify}, APIPermission::kAccessibilityFeaturesModify},
{"cursorColor", ash::prefs::kAccessibilityCursorColorEnabled,
APIPermission::kAccessibilityFeaturesRead,
APIPermission::kAccessibilityFeaturesModify},
{"cursorHighlight", ash::prefs::kAccessibilityCursorHighlightEnabled, {"cursorHighlight", ash::prefs::kAccessibilityCursorHighlightEnabled,
APIPermission::kAccessibilityFeaturesRead, APIPermission::kAccessibilityFeaturesRead,
APIPermission::kAccessibilityFeaturesModify}, APIPermission::kAccessibilityFeaturesModify},
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
}, },
"cursorColor": { "cursorColor": {
"$ref": "types.ChromeSetting", "$ref": "types.ChromeSetting",
"description": "<p><strong>ChromeOS only.</strong></p><p>Cursor color. The value indicates whether the feature is enabled or not. <code>get()</code> requires <code>accessibilityFeatures.read</code> permission. <code>set()</code> and <code>clear()</code> require <code>accessibilityFeatures.modify</code> permission.</p>", "description": "<p><strong>ChromeOS only.</strong></p><p>Cursor color. The value indicates whether the feature is enabled or not, doesn't indicate the color of it. <code>get()</code> requires <code>accessibilityFeatures.read</code> permission. <code>set()</code> and <code>clear()</code> require <code>accessibilityFeatures.modify</code> permission.</p>",
"value": ["cursorColor", {"type": "boolean"}], "value": ["cursorColor", {"type": "boolean"}],
"platforms": ["chromeos"] "platforms": ["chromeos"]
}, },
......
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