summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background')
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js12
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/externs.js62
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/key_map.js17
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js4
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/prefs.js6
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js5
6 files changed, 19 insertions, 87 deletions
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js
index daad1a48933..1f072648861 100644
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js
@@ -281,24 +281,20 @@ cvox.ChromeVoxBackground.prototype.addBridgeListener = function() {
switch (target) {
case 'OpenTab':
- var destination = new Object();
- destination.url = msg['url'];
+ var destination = {url: msg['url']};
chrome.tabs.create(destination);
break;
case 'KbExplorer':
- var explorerPage = new Object();
- explorerPage.url = 'chromevox/background/kbexplorer.html';
+ var explorerPage = {url: 'chromevox/background/kbexplorer.html'};
chrome.tabs.create(explorerPage);
break;
case 'HelpDocs':
- var helpPage = new Object();
- helpPage.url = 'http://chromevox.com/tutorial/index.html';
+ var helpPage = {url: 'http://chromevox.com/tutorial/index.html'};
chrome.tabs.create(helpPage);
break;
case 'Options':
if (action == 'open') {
- var optionsPage = new Object();
- optionsPage.url = 'chromevox/background/options.html';
+ var optionsPage = {url: 'chromevox/background/options.html'};
chrome.tabs.create(optionsPage);
}
break;
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/externs.js b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/externs.js
index fc5a149acba..9b04b6d9bc9 100644
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/externs.js
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/externs.js
@@ -9,29 +9,6 @@ var localStorage = {};
/**
* @type {Object}
*/
-chrome.systemPrivate = {};
-
-/**
- * @param {function(!Object)} callback
- */
-chrome.systemPrivate.getUpdateStatus = function(callback) {};
-
-/** @type {ChromeEvent} */
-chrome.systemPrivate.onBrightnessChanged;
-
-/** @type ChromeEvent */
-chrome.systemPrivate.onVolumeChanged;
-
-/** @type ChromeEvent */
-chrome.systemPrivate.onScreenUnlocked;
-
-/** @type ChromeEvent */
-chrome.systemPrivate.onWokeUp;
-
-
-/**
- * @type {Object}
- */
chrome.accessibilityPrivate = {};
/**
@@ -88,42 +65,3 @@ chrome.accessibilityPrivate.onTextChanged;
chrome.accessibilityPrivate.onChromeVoxLoadStateChanged;
/** @type {function()} */
chrome.accessibilityPrivate.onChromeVoxLoadStateChanged.destroy_;
-
-
-/**
- * @type {Object}
- */
-chrome.experimental = {};
-
-/**
- * @type {Object}
- *
- * TODO(dmazzoni): Remove after the stable version of Chrome no longer
- * has the experimental accessibility API.
- */
-chrome.experimental.accessibility = chrome.accessibilityPrivate;
-
-
-/**
- *
- */
-chrome.app.getDetails = function() {};
-
-/** @constructor */
-var AccessibilityObject = function() {};
-/** @type {string} */
-AccessibilityObject.prototype.type;
-/** @type {string} */
-AccessibilityObject.prototype.name;
-/** @type {Object} */
-AccessibilityObject.prototype.details;
-/** @type {string} */
-AccessibilityObject.prototype.details.value;
-/** @type {number} */
-AccessibilityObject.prototype.details.selectionStart;
-/** @type {number} */
-AccessibilityObject.prototype.details.selectionEnd;
-/** @type {number} */
-AccessibilityObject.prototype.details.itemCount;
-/** @type {number} */
-AccessibilityObject.prototype.details.itemIndex;
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/key_map.js b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/key_map.js
index 5720fa8087b..c3833eca7bc 100644
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/key_map.js
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/key_map.js
@@ -27,16 +27,14 @@ goog.require('cvox.KeyUtil');
goog.require('cvox.PlatformUtil');
/**
- * @param {Array<Object<string,
- * {command: string, sequence: cvox.KeySequence}>>}
+ * @param {Array<Object<{command: string, sequence: cvox.KeySequence}>>}
* commandsAndKeySequences An array of pairs - KeySequences and commands.
* @constructor
*/
cvox.KeyMap = function(commandsAndKeySequences) {
/**
* An array of bindings - commands and KeySequences.
- * @type {Array<Object<string,
- * {command: string, sequence: cvox.KeySequence}>>}
+ * @type {Array<Object<{command: string, sequence: cvox.KeySequence}>>}
* @private
*/
this.bindings_ = commandsAndKeySequences;
@@ -44,7 +42,7 @@ cvox.KeyMap = function(commandsAndKeySequences) {
/**
* Maps a command to a key. This optimizes the process of searching for a
* key sequence when you already know the command.
- * @type {Object<string, cvox.KeySequence>}
+ * @type {Object<cvox.KeySequence>}
* @private
*/
this.commandToKey_ = {};
@@ -66,7 +64,7 @@ cvox.KeyMap.KEYMAP_PATH = 'chromevox/background/keymaps/';
* TODO(dtseng): Not really sure this belongs here, but it doesn't seem to be
* user configurable, so it doesn't make sense to json-stringify it.
* Should have class to siwtch among and manage multiple key maps.
- * @type {Object<string, Object<string, string>>}
+ * @type {Object<Object<string>>}
* @const
*/
cvox.KeyMap.AVAILABLE_MAP_INFO = {
@@ -112,8 +110,7 @@ cvox.KeyMap.prototype.keys = function() {
/**
* Returns a collection of command, KeySequence bindings.
- * @return {Array<Object<string, cvox.KeySequence>>} Array of all command,
- * key bindings.
+ * @return {Array<Object<cvox.KeySequence>>} Array of all command, key bindings.
* @suppress {checkTypes} inconsistent return type
* found : (Array<(Object<{command: string,
* sequence: (cvox.KeySequence|null)}>|null)>|null)
@@ -338,8 +335,8 @@ cvox.KeyMap.fromDefaults = function() {
cvox.KeyMap.fromJSON = function(json) {
try {
var commandsAndKeySequences =
- /** @type {Array<Object<string,
- * {command: string, sequence: cvox.KeySequence}>>} */
+ /** @type {Array<Object<{command: string,
+ * sequence: cvox.KeySequence}>>} */
(JSON.parse(json).bindings);
commandsAndKeySequences = commandsAndKeySequences.filter(function(value) {
return value.sequence.platformFilter === undefined ||
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js
index b40df3c09fc..40434447619 100644
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js
@@ -42,7 +42,7 @@ cvox.OptionsPage.prefs;
/**
* A mapping from keycodes to their human readable text equivalents.
* This is initialized in cvox.OptionsPage.init for internationalization.
- * @type {Object<string, string>}
+ * @type {Object<string>}
*/
cvox.OptionsPage.KEYCODE_TO_TEXT = {
};
@@ -50,7 +50,7 @@ cvox.OptionsPage.KEYCODE_TO_TEXT = {
/**
* A mapping from human readable text to keycode values.
* This is initialized in cvox.OptionsPage.init for internationalization.
- * @type {Object<string, string>}
+ * @type {Object<string>}
*/
cvox.OptionsPage.TEXT_TO_KEYCODE = {
};
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/prefs.js b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/prefs.js
index 15f2938a946..a0d64ef86fa 100644
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/prefs.js
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/prefs.js
@@ -32,7 +32,7 @@ cvox.ChromeVoxPrefs = function() {
if (lastRunVersion == '1.16.0') {
loadExistingSettings = false;
}
- localStorage['lastRunVersion'] = chrome.app.getDetails().version;
+ localStorage['lastRunVersion'] = chrome.runtime.getManifest().version;
/**
* The current mapping from keys to command.
@@ -56,7 +56,7 @@ cvox.ChromeVoxPrefs = function() {
/**
* The default value of all preferences except the key map.
* @const
- * @type {Object<string, Object>}
+ * @type {Object<Object>}
*/
cvox.ChromeVoxPrefs.DEFAULT_PREFS = {
'active': true,
@@ -125,7 +125,7 @@ cvox.ChromeVoxPrefs.prototype.getPrefs = function() {
for (var pref in cvox.ChromeVoxPrefs.DEFAULT_PREFS) {
prefs[pref] = localStorage[pref];
}
- prefs['version'] = chrome.app.getDetails().version;
+ prefs['version'] = chrome.runtime.getManifest().version;
return prefs;
};
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js
index baa004dc9cb..8c48e1dc933 100644
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js
@@ -135,9 +135,10 @@ cvox.TabsApiHandler.prototype = {
return;
}
chrome.windows.get(windowId, function(window) {
- chrome.tabs.getSelected(windowId, function(tab) {
+ chrome.tabs.query({active: true, windowId: windowId}, function(tabs) {
var msgId = window.incognito ? 'chrome_incognito_window_selected' :
- 'chrome_normal_window_selected';
+ 'chrome_normal_window_selected';
+ var tab = tabs[0] || {};
var title = tab.title ? tab.title : tab.url;
this.tts_.speak(this.msg_(msgId, [title]),
cvox.QueueMode.FLUSH,