Commit 38f67ac2 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Remove ChromeVox Classic files from ChromeVox

The main objective is to remove all files reachable from chromevox/injected but not reachable from cvox2/. This resulted in a lot of files being pruned away including some old assets. There was some manual modifications like getting rid of ChromeVoxJSON, host/chrome/ files specific to content scripts, old keymaps, and more.

The testing/ files were also modified accordingly and chromevoxclassic was given its own testing/ fork.

Change-Id: I6f4130f901dcacb2601887d4bcd34d73ff732d56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880174
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709621}
parent 920d0e3b
......@@ -46,78 +46,19 @@ chromevox_modules = [
"chromevox/background/options.js",
"chromevox/background/prefs.js",
"chromevox/background/tabs_api_handler.js",
"chromevox/injected/active_indicator.js",
"chromevox/injected/api_implementation.js",
"chromevox/injected/event_suspender.js",
"chromevox/injected/event_watcher.js",
"chromevox/injected/history.js",
"chromevox/injected/init_document.js",
"chromevox/injected/init_globals.js",
"chromevox/injected/initial_speech.js",
"chromevox/injected/keyboard_handler.js",
"chromevox/injected/live_regions.js",
"chromevox/injected/navigation_history.js",
"chromevox/injected/navigation_manager.js",
"chromevox/injected/navigation_shifter.js",
"chromevox/injected/navigation_speaker.js",
"chromevox/injected/node_breadcrumb.js",
"chromevox/injected/script_installer.js",
"chromevox/injected/serializer.js",
"chromevox/injected/ui/braille_overlay_widget.js",
"chromevox/injected/ui/context_menu_widget.js",
"chromevox/injected/ui/keyboard_help_widget.js",
"chromevox/injected/ui/node_search_widget.js",
"chromevox/injected/ui/overlay_widget.js",
"chromevox/injected/ui/search_widget.js",
"chromevox/injected/ui/select_widget.js",
"chromevox/injected/ui/spoken_messages.js",
"chromevox/injected/ui/widget.js",
"chromevox/injected/user_commands.js",
"chromevox/injected/user_event_detail.js",
"common/aria_util.js",
"common/aural_style_util.js",
"common/braille_text_handler.js",
"common/braille_util.js",
"common/buildinfo.js",
"cvox2/injected/api_implementation.js",
"cvox2/injected/script_installer.js",
"common/chromevox.js",
"common/chromevox_json.js",
"common/command_store.js",
"common/composite_tts.js",
"common/content_editable_extractor.js",
"common/cursor.js",
"common/cursor_selection.js",
"common/date_widget.js",
"common/description_util.js",
"common/dom_predicates.js",
"common/dom_util.js",
"common/earcon_util.js",
"common/editable_text.js",
"common/editable_text_area_shadow.js",
"common/editable_text_base.js",
"common/find_util.js",
"common/focus_util.js",
"common/focuser.js",
"common/group_util.js",
"common/interframe.js",
"common/key_sequence.js",
"common/key_util.js",
"common/media_widget.js",
"common/memoize.js",
"common/keyboard_handler.js",
"common/msgs.js",
"common/nav_description.js",
"common/nav_math_description.js",
"common/node_state.js",
"common/page_selection.js",
"common/platform_util.js",
"common/selection_util.js",
"common/spannable.js",
"common/string_util.js",
"common/table_util.js",
"common/time_widget.js",
"common/traverse_content.js",
"common/traverse_table.js",
"common/traverse_util.js",
"common/xpath_util.js",
"cvox2/background/automation_object_constructor_installer.js",
"cvox2/background/automation_predicate.js",
"cvox2/background/automation_util.js",
......@@ -142,8 +83,8 @@ chromevox_modules = [
"cvox2/background/gesture_command_data.js",
"cvox2/background/gesture_command_handler.js",
"cvox2/background/i_search.js",
"cvox2/background/keyboard_handler.js",
"cvox2/background/language_switching.js",
"cvox2/background/keyboard_handler.js",
"cvox2/background/live_regions.js",
"cvox2/background/log.js",
"cvox2/background/log_store.js",
......@@ -164,48 +105,17 @@ chromevox_modules = [
"cvox2/background/tree_dumper.js",
"cvox2/background/tree_walker.js",
"cvox2/background/tutorial.js",
"cvox2/injected/keyboard_handler.js",
"cvox2/injected/loader.js",
"extensions/searchvox/abstract_result.js",
"extensions/searchvox/constants.js",
"extensions/searchvox/context_menu.js",
"extensions/searchvox/loader.js",
"extensions/searchvox/results.js",
"extensions/searchvox/search.js",
"extensions/searchvox/search_tools.js",
"extensions/searchvox/util.js",
"host/chrome/braille.js",
"host/chrome/braille_background.js",
"host/chrome/classic_earcons.js",
"host/chrome/earcons.js",
"host/chrome/extension_bridge.js",
"host/chrome/host.js",
"host/chrome/tts.js",
"host/chrome/tts_background.js",
"host/chrome/tts_base.js",
"host/interface/abstract_earcons.js",
"host/interface/abstract_host.js",
"host/interface/abstract_tts.js",
"host/interface/braille_interface.js",
"host/interface/host_factory.js",
"host/interface/tts_interface.js",
"third_party/tamachiyomi/ja_phonetic_data.js",
"walkers/abstract_node_walker.js",
"walkers/abstract_selection_walker.js",
"walkers/abstract_shifter.js",
"walkers/abstract_walker.js",
"walkers/bare_object_walker.js",
"walkers/character_walker.js",
"walkers/column_walker.js",
"walkers/group_walker.js",
"walkers/layout_line_walker.js",
"walkers/object_walker.js",
"walkers/row_walker.js",
"walkers/sentence_walker.js",
"walkers/structural_line_walker.js",
"walkers/table_shifter.js",
"walkers/table_walker.js",
"walkers/word_walker.js",
]
# Closure library modules neede by chromevox.
......@@ -239,7 +149,6 @@ group("chromevox") {
if (chromevox_compress_js) {
deps += [
":chromevox_background_script",
":chromevox_content_script",
":chromevox_kbexplorer_script",
":chromevox_log_script",
":chromevox_min_content_script",
......@@ -252,7 +161,6 @@ group("chromevox") {
}
chromevox_background_script_loader_file = "cvox2/background/loader.js"
chromevox_content_script_loader_file = "chromevox/injected/loader.js"
chromevox_kbexplorer_loader_file = "chromevox/background/kbexplorer_loader.js"
chromevox_log_loader_file = "cvox2/background/log_loader.js"
chromevox_min_content_script_loader_file = "cvox2/injected/loader.js"
......@@ -293,14 +201,10 @@ run_jsbundler("chromevox_copied_files") {
"chromevox/background/earcons/wrap.ogg",
"chromevox/background/earcons/wrap_edge.ogg",
"chromevox/background/kbexplorer.html",
"chromevox/background/keymaps/classic_keymap.json",
"chromevox/background/keymaps/experimental.json",
"chromevox/background/keymaps/flat_keymap.json",
"chromevox/background/keymaps/next_keymap.json",
"chromevox/background/options.css",
"chromevox/background/options.html",
"chromevox/background/unchecked.png",
"chromevox/injected/api.js",
"cvox2/background/background.html",
"cvox2/background/earcons/control.wav",
"cvox2/background/earcons/selection.wav",
......@@ -312,6 +216,7 @@ run_jsbundler("chromevox_copied_files") {
"cvox2/background/log.html",
"cvox2/background/panel.css",
"cvox2/background/panel.html",
"cvox2/injected/api.js",
"images/chromevox-128.png",
"images/chromevox-16.png",
"images/chromevox-19.png",
......@@ -328,7 +233,6 @@ run_jsbundler("chromevox_copied_files") {
sources += [
"closure/closure_preinit.js",
chromevox_background_script_loader_file,
chromevox_content_script_loader_file,
chromevox_kbexplorer_loader_file,
chromevox_log_loader_file,
chromevox_min_content_script_loader_file,
......@@ -437,13 +341,6 @@ if (chromevox_compress_js) {
}
}
compress_js("chromevox_content_script") {
sources = [
chromevox_content_script_loader_file,
]
output_file = "$chromevox_out_dir/chromeVoxChromePageScript.js"
}
compress_js("chromevox_kbexplorer_script") {
sources = [
chromevox_kbexplorer_loader_file,
......@@ -546,14 +443,8 @@ action("chromevox_test_messages_js") {
] + rebase_path(sources, root_build_dir)
}
chromevox_test_modules = [
"host/testing/earcons.js",
"host/testing/host.js",
"host/testing/tts.js",
"testing/spoken_list_builder.js",
"testing/test_msgs.js",
"testing/tester.js",
] + get_target_outputs(":chromevox_test_messages_js")
chromevox_test_modules = [ "testing/test_msgs.js" ] +
get_target_outputs(":chromevox_test_messages_js")
generate_deps_js("chromevox_test_deps_js") {
sources = closure_library_modules + chromevox_modules + chromevox_test_modules
......@@ -576,8 +467,7 @@ js2gtest("chromevox_unitjs_tests") {
"braille/braille_input_handler_test.unitjs",
"braille/expanding_braille_translator_test.unitjs",
"braille/pan_strategy_test.unitjs",
"common/command_store_test.unitjs",
"host/chrome/braille_integration_test.unitjs",
"common/spannable_test.unitjs",
"testing/mock_feedback_test.unitjs",
]
gen_include_files = [
......
......@@ -170,13 +170,33 @@ FakeEditor.prototype.message_ = function(msg) {
};
FakeEditor.prototype.createValue = function(
text, opt_selStart, opt_selEnd, opt_textOffset) {
var spannable = new Spannable(text, new cvox.ValueSpan(opt_textOffset || 0));
if (goog.isDef(opt_selStart)) {
opt_selEnd = goog.isDef(opt_selEnd) ? opt_selEnd : opt_selStart;
// TODO(plundblad): This looses the distinction between the selection
// anchor (start) and focus (end). We should use that information to
// decide where to pan the braille display.
if (opt_selStart > opt_selEnd) {
var temp = opt_selStart;
opt_selStart = opt_selEnd;
opt_selEnd = temp;
}
spannable.setSpan(new cvox.ValueSelectionSpan(), opt_selStart, opt_selEnd);
}
return spannable;
};
/**
* Calls the {@code onDisplayContentChanged} method of the input handler
* with the current editor content and selection.
* @private
*/
FakeEditor.prototype.callOnDisplayContentChanged_ = function() {
var content = cvox.BrailleUtil.createValue(
var content = this.createValue(
this.text_, this.selectionStart_, this.selectionEnd_)
var grabExtraCells = function() {
var span = content.getSpanInstanceOf(cvox.ExtraCellsSpan);
......@@ -438,7 +458,6 @@ ChromeVoxBrailleInputHandlerUnitTest.prototype = {
/** @override */
closureModuleDeps: [
'cvox.BrailleInputHandler',
'cvox.BrailleUtil',
],
/**
......
......@@ -25,8 +25,6 @@ goog.require('cvox.CompositeTts');
goog.require('cvox.ExtensionBridge');
goog.require('cvox.InjectedScriptLoader');
goog.require('cvox.NavBraille');
goog.require('cvox.PlatformFilter');
goog.require('cvox.PlatformUtil');
goog.require('cvox.QueueMode');
goog.require('cvox.TabsApiHandler');
goog.require('cvox.TtsBackground');
......@@ -216,7 +214,7 @@ cvox.ChromeVoxBackground.prototype.injectChromeVoxIntoTabs = function(tabs) {
// the manifest files.
if (COMPILED) {
listOfFiles =
['chromeVoxChromePageScript.js', 'chromeVox2ChromePageScript.js'];
['chromeVox2ChromePageScript.js'];
} else {
listOfFiles = [
'closure/closure_preinit.js', 'closure/base.js', 'deps.js',
......
......@@ -24,7 +24,6 @@ goog.provide('cvox.KeyMap');
// TODO(dtseng): Only needed for sticky mode.
goog.require('cvox.KeyUtil');
goog.require('cvox.PlatformUtil');
/**
* @param {Array<Object<{command: string, sequence: cvox.KeySequence}>>}
......@@ -68,10 +67,7 @@ cvox.KeyMap.KEYMAP_PATH = 'chromevox/background/keymaps/';
* @const
*/
cvox.KeyMap.AVAILABLE_MAP_INFO = {
'keymap_classic': {'file': 'classic_keymap.json'},
'keymap_flat': {'file': 'flat_keymap.json'},
'keymap_next': {'file': 'next_keymap.json'},
'keymap_experimental': {'file': 'experimental.json'}
'keymap_next': {'file': 'next_keymap.json'}
};
......@@ -314,7 +310,7 @@ cvox.KeyMap.prototype.bind_ = function(command, newKey) {
cvox.KeyMap.fromDefaults = function() {
return /** @type {!cvox.KeyMap} */ (cvox.KeyMap.fromPath(
cvox.KeyMap.KEYMAP_PATH +
cvox.KeyMap.AVAILABLE_MAP_INFO['keymap_classic'].file));
cvox.KeyMap.AVAILABLE_MAP_INFO['keymap_next'].file));
};
......@@ -341,10 +337,6 @@ cvox.KeyMap.fromJSON = function(json) {
/** @type {Array<Object<{command: string,
* sequence: cvox.KeySequence}>>} */
(JSON.parse(json).bindings);
commandsAndKeySequences = commandsAndKeySequences.filter(function(value) {
return value.sequence.platformFilter === undefined ||
cvox.PlatformUtil.matchesPlatform(value.sequence.platformFilter);
});
} catch (e) {
console.error('Failed to load key map from JSON');
console.error(e);
......
......@@ -448,18 +448,6 @@
}
}
},
{
"command": "toggleStickyMode",
"sequence": {
"doubleTap": true,
"keys": {
"keyCode": [
45
]
},
"platformFilter": 5
}
},
{
"command": "toggleStickyMode",
"sequence": {
......@@ -469,8 +457,7 @@
"keyCode": [
91
]
},
"platformFilter": 10
}
}
},
{
......
......@@ -16,14 +16,10 @@ goog.require('Msgs');
goog.require('PanelCommand');
goog.require('cvox.BrailleTable');
goog.require('cvox.BrailleTranslatorManager');
goog.require('cvox.ChromeEarcons');
goog.require('cvox.ChromeTts');
goog.require('cvox.ChromeVox');
goog.require('cvox.ChromeVoxPrefs');
goog.require('cvox.CommandStore');
goog.require('cvox.ExtensionBridge');
goog.require('cvox.PlatformFilter');
goog.require('cvox.PlatformUtil');
/**
* Class to manage the options page.
......@@ -164,10 +160,6 @@ cvox.OptionsPage.init = function() {
}
});
if (cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.WML)) {
$('version').textContent = chrome.app.getDetails().version;
}
var clearVirtualDisplay = function() {
var groups = [];
var sizeOfDisplay =
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Allows events to be suspended.
*
*/
goog.provide('cvox.ChromeVoxEventSuspender');
/**
* @namespace
*/
cvox.ChromeVoxEventSuspender = function() {};
/**
* A nestable variable to keep track of whether events are suspended.
*
* @type {number}
* @private
*/
cvox.ChromeVoxEventSuspender.suspendLevel_ = 0;
/**
* Enters a (nested) suspended state.
*/
cvox.ChromeVoxEventSuspender.enterSuspendEvents = function() {
cvox.ChromeVoxEventSuspender.suspendLevel_ += 1;
};
/**
* Exits a (nested) suspended state.
*/
cvox.ChromeVoxEventSuspender.exitSuspendEvents = function() {
cvox.ChromeVoxEventSuspender.suspendLevel_ -= 1;
};
/**
* Returns true if events are currently suspended.
*
* @return {boolean} True if events are suspended.
*/
cvox.ChromeVoxEventSuspender.areEventsSuspended = function() {
return cvox.ChromeVoxEventSuspender.suspendLevel_ > 0;
};
/**
* Returns a function that runs the argument with all events suspended.
*
* @param {Function} f Function to run with suspended events.
* @return {?} Returns a function that wraps f.
*/
cvox.ChromeVoxEventSuspender.withSuspendedEvents = function(f) {
return function() {
cvox.ChromeVoxEventSuspender.enterSuspendEvents();
var ret = f.apply(this, arguments);
cvox.ChromeVoxEventSuspender.exitSuspendEvents();
return ret;
};
};
/**
* Returns a handler that only runs the argument if events are not suspended.
*
* @param {Function} handler Function that will be used as an event handler.
* @param {boolean} ret Return value if events are suspended.
* @return {Function} Function wrapping the handler.
*/
cvox.ChromeVoxEventSuspender.makeSuspendableHandler = function(handler, ret) {
return function() {
if (cvox.ChromeVoxEventSuspender.areEventsSuspended()) {
return ret;
}
return handler();
};
};
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Build info for ChromeVox.
*
* This file may be replaced in package.py for dev builds.
* For releases, it is updated by hand with meaningful values.
*
*/
goog.provide('cvox.BuildInfo');
/**
* An identified for this build.
* @type {string}
*/
cvox.BuildInfo.build = 'development build';
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