Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox2/cvox2/background/background.js

Issue 572373002: Refactor tabs API handlers out of AccessibilityApiHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Getting out of a bind. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox2/chromevox.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview The entry point for all ChromeVox2 related code for the 6 * @fileoverview The entry point for all ChromeVox2 related code for the
7 * background page. 7 * background page.
8 */ 8 */
9 9
10 goog.provide('cvox2.Background'); 10 goog.provide('cvox2.Background');
11 goog.provide('cvox2.global'); 11 goog.provide('cvox2.global');
12 12
13 goog.require('cvox.TabsApiHandler');
14
13 /** Classic Chrome accessibility API. */ 15 /** Classic Chrome accessibility API. */
14 cvox2.global.accessibility = 16 cvox2.global.accessibility =
15 chrome.accessibilityPrivate || chrome.experimental.accessibility; 17 chrome.accessibilityPrivate || chrome.experimental.accessibility;
16 18
17 /** 19 /**
18 * ChromeVox2 background page. 20 * ChromeVox2 background page.
19 */ 21 */
20 cvox2.Background = function() { 22 cvox2.Background = function() {
21 /** 23 /**
22 * A list of site substring patterns to use with ChromeVox next. Keep these 24 * A list of site substring patterns to use with ChromeVox next. Keep these
23 * strings relatively specific. 25 * strings relatively specific.
24 * @type {!Array.<string>} 26 * @type {!Array.<string>}
25 */ 27 */
26 this.whitelist_ = ['http://www.chromevox.com/', 'chromevox_next_test']; 28 this.whitelist_ = ['http://www.chromevox.com/', 'chromevox_next_test'];
27 29
30 /** @type {cvox.TabsApiHandler} @private */
31 this.tabsHandler_ = new cvox.TabsApiHandler(cvox.ChromeVox.tts,
32 cvox.ChromeVox.braille,
33 cvox.ChromeVox.earcons);
34
28 // Only needed with unmerged ChromeVox classic loaded before. 35 // Only needed with unmerged ChromeVox classic loaded before.
29 // TODO(dtseng): Refactor all tabs handlers out of
30 // accessibility_api_handler.js.
31 cvox2.global.accessibility.setAccessibilityEnabled(false); 36 cvox2.global.accessibility.setAccessibilityEnabled(false);
32 37
33 // Manually bind all functions to |this|. 38 // Manually bind all functions to |this|.
34 for (var func in this) { 39 for (var func in this) {
35 if (typeof(this[func]) == 'function') 40 if (typeof(this[func]) == 'function')
36 this[func] = this[func].bind(this); 41 this[func] = this[func].bind(this);
37 } 42 }
38 43
39 // Register listeners for ... 44 // Register listeners for ...
40 // Desktop. 45 // Desktop.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 disableClassicChromeVox_: function(tabId) { 121 disableClassicChromeVox_: function(tabId) {
117 chrome.tabs.executeScript( 122 chrome.tabs.executeScript(
118 tabId, 123 tabId,
119 {'code': 'try { window.disableChromeVox(); } catch(e) { }\n', 124 {'code': 'try { window.disableChromeVox(); } catch(e) { }\n',
120 'allFrames': true}); 125 'allFrames': true});
121 } 126 }
122 }; 127 };
123 128
124 /** @type {cvox2.Background} */ 129 /** @type {cvox2.Background} */
125 cvox2.global.backgroundObj = new cvox2.Background(); 130 cvox2.global.backgroundObj = new cvox2.Background();
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox2/chromevox.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698