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

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

Issue 1282593002: Add ChromeVox panel and implement caption display functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes to accessibility_manager in this change Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_command.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_command.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_command.js
new file mode 100644
index 0000000000000000000000000000000000000000..3642b96db141ee0b9a0663e71dbff6591d9d654a
--- /dev/null
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_command.js
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Commands to pass to the ChromeVox Panel.
+ */
+
+goog.provide('cvox.PanelCommand');
+goog.provide('cvox.PanelCommandType');
+
+/**
+ * Create one command to pass to the ChromeVox Panel.
+ * @param {cvox.PanelCommandType} type The type of command.
+ * @param {string|ArrayBuffer=} opt_data
+ * Optional data associated with the command.
+ * @constructor
+ */
+cvox.PanelCommand = function(type, opt_data) {
+ this.type = type;
+ this.data = opt_data;
+};
+
+/**
+ * Send this command to the ChromeVox Panel window.
+ */
+cvox.PanelCommand.prototype.send = function() {
+ var views = chrome.extension.getViews();
+ for (var i = 0; i < views.length; i++) {
+ if (views[i].location.href.indexOf('background/panel.html') > 0) {
+ console.log('Posting to panel: ' + JSON.stringify(this));
+ views[i].postMessage(JSON.stringify(this), window.location.origin);
+ }
+ }
+};
+
+/**
+ * Possible panel commands.
+ * @enum {string}
+ */
+cvox.PanelCommandType = {
+ CLEAR_SPEECH: 'clear_speech',
+ ADD_NORMAL_SPEECH: 'add_normal_speech',
+ ADD_ANNOTATION_SPEECH: 'add_annotation_speech',
+ UPDATE_BRAILLE_TEXT: 'update_braille_text',
+ UPDATE_BRAILLE_CELLS: 'update_braille_cells'
+};

Powered by Google App Engine
This is Rietveld 408576698