OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 /** | |
6 * @fileoverview An interface for querying and modifying the global | |
7 * ChromeVox state, to avoid direct dependencies on the Background | |
8 * object and to facilitate mocking for tests. | |
9 */ | |
10 | |
11 goog.provide('ChromeVoxMode'); | |
12 goog.provide('ChromeVoxState'); | |
13 | |
14 goog.require('cursors.Cursor'); | |
15 | |
16 /** | |
17 * All possible modes ChromeVox can run. | |
18 * @enum {string} | |
19 */ | |
20 ChromeVoxMode = { | |
21 CLASSIC: 'classic', | |
22 COMPAT: 'compat', | |
23 NEXT: 'next', | |
24 FORCE_NEXT: 'force_next' | |
25 }; | |
26 | |
27 /** | |
28 * ChromeVox2 state object. | |
29 * @constructor | |
30 */ | |
31 ChromeVoxState = function() { | |
32 }; | |
33 | |
34 ChromeVoxState.prototype = { | |
35 /** @type {ChromeVoxMode} */ | |
36 get mode() { | |
37 return this.getMode(); | |
38 }, | |
39 | |
40 /** | |
41 * @return {ChromeVoxMode} The current mode. | |
42 */ | |
43 getMode: function() { | |
44 return ChromeVoxMode.NEXT; | |
45 }, | |
46 | |
47 /** | |
48 * Sets the current ChromeVox mode. | |
49 * @param {ChromeVoxMode} mode | |
50 * @param {boolean=} opt_injectClassic Injects ChromeVox classic into tabs; | |
51 * defaults to false. | |
52 */ | |
53 setMode: function(mode, opt_injectClassic) { | |
54 }, | |
55 | |
56 /** @type {cursors.Range} */ | |
57 get currentRange() { | |
58 return this.getCurrentRange(); | |
59 }, | |
60 | |
61 /** | |
62 * @return {cursors.Range} The current range. | |
63 */ | |
64 getCurrentRange: function() { | |
Peter Lundblad
2015/11/24 11:04:31
Perhaps make the get* methods private to enforce c
dmazzoni
2015/11/30 22:00:47
Done.
| |
65 return null; | |
66 }, | |
67 | |
68 /** | |
69 * @param {cursors.Range} newRange The new range. | |
70 */ | |
71 setCurrentRange: function(newRange) { | |
Peter Lundblad
2015/11/24 11:04:31
How about making all these 'stub' methods goog.abs
dmazzoni
2015/11/30 22:00:47
Done.
dmazzoni
2015/12/01 08:19:47
Hmmm, I tried this but got weird errors because th
| |
72 }, | |
73 }; | |
OLD | NEW |