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

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

Issue 1277183003: Add ChromeVox panel and implement caption display functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address last feedback Created 5 years, 1 month 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
(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 Commands to pass from the ChromeVox background page context
7 * to the ChromeVox Panel.
8 */
9
10 goog.provide('PanelCommand');
11 goog.provide('PanelCommandType');
12
13 /**
14 * Create one command to pass to the ChromeVox Panel.
15 * @param {PanelCommandType} type The type of command.
16 * @param {string|ArrayBuffer|{text: string, braille: string}=} opt_data
Peter Lundblad 2015/11/10 10:46:36 Remove the ArrayBuffer. Not needed, and wouldn't b
dmazzoni 2015/11/10 17:33:17 Done.
17 * Optional data associated with the command.
18 * @constructor
19 */
20 PanelCommand = function(type, opt_data) {
21 this.type = type;
22 this.data = opt_data;
23 };
24
25 /**
26 * Send this command to the ChromeVox Panel window.
27 */
28 PanelCommand.prototype.send = function() {
29 var views = chrome.extension.getViews();
30 for (var i = 0; i < views.length; i++) {
31 if (views[i].location.href.indexOf('background/panel.html') > 0) {
32 views[i].postMessage(JSON.stringify(this), window.location.origin);
33 }
34 }
35 };
36
37 /**
38 * Possible panel commands.
39 * @enum {string}
40 */
41 PanelCommandType = {
42 CLEAR_SPEECH: 'clear_speech',
43 ADD_NORMAL_SPEECH: 'add_normal_speech',
44 ADD_ANNOTATION_SPEECH: 'add_annotation_speech',
45 UPDATE_BRAILLE: 'update_braille',
46 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698