Commit 62b139f3 authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Add BUILD file for Caret Browsing extension, update one string.

The last time we updated this was before the GYP -> GN switch.
This change adds a build rule for the caret browsing extension.

Also fixes description of keyboard shortcut for Caret Browsing on
Chrome OS. The right way to generate F7 is Search+IncreaseBrightness now,
not Alt.

Bug: none
Change-Id: I70b645ce65e2f5e8310cec6ce02e3083b9f6e2df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850197Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708355}
parent 65679d03
...@@ -6,17 +6,11 @@ import("//tools/grit/grit_rule.gni") ...@@ -6,17 +6,11 @@ import("//tools/grit/grit_rule.gni")
group("extensions") { group("extensions") {
deps = [ deps = [
":caretbrowsing",
":colorenhancer", ":colorenhancer",
] ]
} }
group("colorenhancer") {
deps = [
":colorenhancer_copy",
":colorenhancer_strings",
]
}
locale_files = [ locale_files = [
"_locales/am/messages.json", "_locales/am/messages.json",
"_locales/ar/messages.json", "_locales/ar/messages.json",
...@@ -73,6 +67,17 @@ locale_files = [ ...@@ -73,6 +67,17 @@ locale_files = [
"_locales/zh_TW/messages.json", "_locales/zh_TW/messages.json",
] ]
#
# Color Enhancer
#
group("colorenhancer") {
deps = [
":colorenhancer_copy",
":colorenhancer_strings",
]
}
grit("colorenhancer_strings") { grit("colorenhancer_strings") {
source = "strings/accessibility_extensions_strings.grd" source = "strings/accessibility_extensions_strings.grd"
outputs = locale_files outputs = locale_files
...@@ -103,3 +108,46 @@ copy("colorenhancer_copy") { ...@@ -103,3 +108,46 @@ copy("colorenhancer_copy") {
"$root_out_dir/{{source_target_relative}}", "$root_out_dir/{{source_target_relative}}",
] ]
} }
#
# Caret Browsing
#
group("caretbrowsing") {
deps = [
":caretbrowsing_copy",
":caretbrowsing_strings",
]
}
grit("caretbrowsing_strings") {
source = "strings/accessibility_extensions_strings.grd"
outputs = locale_files
output_dir = "$root_out_dir/caretbrowsing"
depfile_dir = "$root_out_dir"
resource_ids = ""
}
caretbrowsing_files = [
"caretbrowsing/background.js",
"caretbrowsing/caret_128.png",
"caretbrowsing/caret_16.png",
"caretbrowsing/caret_19_on.png",
"caretbrowsing/caret_19.png",
"caretbrowsing/caret_48.png",
"caretbrowsing/caretbrowsing.css",
"caretbrowsing/caretbrowsing.js",
"caretbrowsing/increase_brightness.png",
"caretbrowsing/manifest.json",
"caretbrowsing/options.html",
"caretbrowsing/options.js",
"caretbrowsing/traverse_util.js",
"//third_party/accessibility-audit/axs_testing.js",
]
copy("caretbrowsing_copy") {
sources = caretbrowsing_files
outputs = [
"$root_out_dir/caretbrowsing/{{source_file_part}}",
]
}
...@@ -6,8 +6,7 @@ one-click install from the Settings page. ...@@ -6,8 +6,7 @@ one-click install from the Settings page.
# Building # Building
# #
Right now only the colorenhancer needs to be built, because it has localized Some of the extensions have localized strings and need to be built:
strings. To build it:
ninja -C out/Release ui/accessibility/extensions ninja -C out/Release ui/accessibility/extensions
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
"description": "Instructions for how to enable or disable this feature on any platform other than Chrome OS." "description": "Instructions for how to enable or disable this feature on any platform other than Chrome OS."
}, },
"enableDisableCros": { "enableDisableCros": {
"message": "Press <span class='key'>Alt</span> + <img src='increase_brightness.png'> (the Increase Brightness key, or F7) to turn on Caret Browsing. Press it again to turn it off.", "message": "Press <span class='key'>Search</span> + <img src='increase_brightness.png'> (the Increase Brightness key, or F7) to turn on Caret Browsing. Press it again to turn it off.",
"description": "Instructions for how to enable or disable this feature on a Chromebook, where you have to hold Alt and press the special Increase Brightness key on the top of the keyboard, or F7 if you're using an alternate keyboard." "description": "Instructions for how to enable or disable this feature on a Chromebook, where you have to hold Search and press the special Increase Brightness key on the top of the keyboard, or F7 if you're using an alternate keyboard."
}, },
"moveByWordsNonMac": { "moveByWordsNonMac": {
"message": "Hold down <span class='key'>Control</span> to move by words.", "message": "Hold down <span class='key'>Control</span> to move by words.",
......
...@@ -618,8 +618,8 @@ CaretBrowsing.updateCaretOrSelection = function(scrollToSelection) { ...@@ -618,8 +618,8 @@ CaretBrowsing.updateCaretOrSelection = function(scrollToSelection) {
var style = window.getComputedStyle(elem); var style = window.getComputedStyle(elem);
var bg = axs.utils.getBgColor(style, elem); var bg = axs.utils.getBgColor(style, elem);
var fg = axs.utils.getFgColor(style, elem, bg); var fg = axs.utils.getFgColor(style, elem, bg);
CaretBrowsing.caretBackground = axs.utils.colorToString(bg); CaretBrowsing.caretBackground = axs.color.colorToString(bg);
CaretBrowsing.caretForeground = axs.utils.colorToString(fg); CaretBrowsing.caretForeground = axs.color.colorToString(fg);
if (scrollToSelection) { if (scrollToSelection) {
// Scroll just to the "focus" position of the selection, // Scroll just to the "focus" position of the selection,
......
{ {
"name": "__MSG_CARET_BROWSING_APPNAME__", "name": "__MSG_CARET_BROWSING_APPNAME__",
"version": "1.0.1", "version": "1.0.2",
"description": "__MSG_CARET_BROWSING_APPDESC__", "description": "__MSG_CARET_BROWSING_APPDESC__",
"manifest_version": 2, "manifest_version": 2,
"permissions": [ "permissions": [
......
...@@ -217,8 +217,8 @@ ...@@ -217,8 +217,8 @@
<message desc="The title of the options page." name="IDS_CARET_BROWSING_CARETBROWSINGOPTIONS"> <message desc="The title of the options page." name="IDS_CARET_BROWSING_CARETBROWSINGOPTIONS">
Caret Browsing Options Caret Browsing Options
</message> </message>
<message desc="Instructions for how to enable or disable this feature on a Chromebook, where you have to hold Alt and press the special Increase Brightness key on the top of the keyboard, or F7 if you're using an alternate keyboard." name="IDS_CARET_BROWSING_ENABLEDISABLECROS"> <message desc="Instructions for how to enable or disable this feature on a Chromebook, where you have to hold Search and press the special Increase Brightness key on the top of the keyboard, or F7 if you're using an alternate keyboard." name="IDS_CARET_BROWSING_ENABLEDISABLECROS">
Press &lt;span class='key'&gt;Alt&lt;/span&gt; + &lt;img src='increase_brightness.png'&gt; (the Increase Brightness key, or F7) to turn on Caret Browsing. Press it again to turn it off. Press &lt;span class='key'&gt;Search&lt;/span&gt; + &lt;img src='increase_brightness.png'&gt; (the Increase Brightness key, or F7) to turn on Caret Browsing. Press it again to turn it off.
</message> </message>
<message desc="Instructions for how to enable or disable this feature on any platform other than Chrome OS." name="IDS_CARET_BROWSING_ENABLEDISABLENONCROS"> <message desc="Instructions for how to enable or disable this feature on any platform other than Chrome OS." name="IDS_CARET_BROWSING_ENABLEDISABLENONCROS">
Press &lt;span class='key'&gt;F7&lt;/span&gt; to turn on Caret Browsing. Press it again to turn it off. Press &lt;span class='key'&gt;F7&lt;/span&gt; to turn on Caret Browsing. Press it again to turn it off.
......
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