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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/host/interface/host_factory.js

Issue 593133002: Refactor: remove a Chromevox abstract class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 years, 2 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
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 /** 6 /**
7 * @fileoverview A host factory. This factory allows us to decouple the 7 * @fileoverview A host factory. This factory allows us to decouple the
8 * cvox.Host|Tts|... creatation from the main ChromeVox code. 8 * cvox.Host|Tts|... creatation from the main ChromeVox code.
9 */ 9 */
10 10
11 goog.provide('cvox.HostFactory'); 11 goog.provide('cvox.HostFactory');
12 12
13 goog.require('cvox.AbstractBraille');
13 goog.require('cvox.AbstractEarcons'); 14 goog.require('cvox.AbstractEarcons');
14 goog.require('cvox.AbstractHost'); 15 goog.require('cvox.AbstractHost');
15 goog.require('cvox.AbstractMathJax'); 16 goog.require('cvox.AbstractMathJax');
16 goog.require('cvox.AbstractMsgs');
17 goog.require('cvox.AbstractTts'); 17 goog.require('cvox.AbstractTts');
18 goog.require('cvox.AbstractBraille');
19
20
21 18
22 19
23 /** 20 /**
24 * @namespace. 21 * @constructor
25 */ 22 */
26 cvox.HostFactory = function() {}; 23 cvox.HostFactory = function() {};
27 24
28 /** 25 /**
29 * Returns the host. 26 * Returns the host.
30 * @return {cvox.AbstractHost} 27 * @return {cvox.AbstractHost}
31 */ 28 */
32 cvox.HostFactory.getHost = function() { 29 cvox.HostFactory.getHost = function() {
33 return new cvox.HostFactory.hostConstructor; 30 return new cvox.HostFactory.hostConstructor;
34 }; 31 };
35 32
36 /** 33 /**
37 * Returns the TTS interface. 34 * Returns the TTS interface.
38 * @return {cvox.TtsInterface} The TTS engine. 35 * @return {cvox.TtsInterface} The TTS engine.
39 */ 36 */
40 cvox.HostFactory.getTts = function() { 37 cvox.HostFactory.getTts = function() {
41 return new cvox.HostFactory.ttsConstructor; 38 return new cvox.HostFactory.ttsConstructor;
42 }; 39 };
43 40
44 /** 41 /**
45 * Returns the Braille interface. 42 * Returns the Braille interface.
46 * @return {cvox.BrailleInterface} The Braille interface. 43 * @return {cvox.BrailleInterface} The Braille interface.
47 */ 44 */
48 cvox.HostFactory.getBraille = function() { 45 cvox.HostFactory.getBraille = function() {
49 return new cvox.HostFactory.brailleConstructor; 46 return new cvox.HostFactory.brailleConstructor;
50 }; 47 };
51 48
52 /** 49 /**
53 * Returns the message interface.
54 * @return {cvox.AbstractMsgs}
55 */
56 cvox.HostFactory.getMsgs = function() {
57 return new cvox.HostFactory.msgsConstructor;
58 };
59
60 /**
61 * Returns the earcons interface. 50 * Returns the earcons interface.
62 * @return {cvox.AbstractEarcons} 51 * @return {cvox.AbstractEarcons}
63 */ 52 */
64 cvox.HostFactory.getEarcons = function() { 53 cvox.HostFactory.getEarcons = function() {
65 return new cvox.HostFactory.earconsConstructor; 54 return new cvox.HostFactory.earconsConstructor;
66 }; 55 };
67 56
68 /** 57 /**
69 * Returns the MathJax interface. 58 * Returns the MathJax interface.
70 * @return {cvox.MathJaxInterface} The MathJax interface. 59 * @return {cvox.MathJaxInterface} The MathJax interface.
(...skipping 11 matching lines...) Expand all
82 * @type {function (new:cvox.TtsInterface)} 71 * @type {function (new:cvox.TtsInterface)}
83 */ 72 */
84 cvox.HostFactory.ttsConstructor; 73 cvox.HostFactory.ttsConstructor;
85 74
86 /** 75 /**
87 * @type {function (new:cvox.BrailleInterface)} 76 * @type {function (new:cvox.BrailleInterface)}
88 */ 77 */
89 cvox.HostFactory.brailleConstructor; 78 cvox.HostFactory.brailleConstructor;
90 79
91 /** 80 /**
92 * @type {function (new:cvox.AbstractMsgs)}
93 */
94 cvox.HostFactory.msgsConstructor;
95
96 /**
97 * @type {function (new:cvox.AbstractEarcons)} 81 * @type {function (new:cvox.AbstractEarcons)}
98 */ 82 */
99 cvox.HostFactory.earconsConstructor; 83 cvox.HostFactory.earconsConstructor;
100 84
101 85
102 /** 86 /**
103 * @type {function (new:cvox.AbstractMathJax)} 87 * @type {function (new:cvox.AbstractMathJax)}
104 */ 88 */
105 cvox.HostFactory.mathJaxConstructor; 89 cvox.HostFactory.mathJaxConstructor;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698