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

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

Issue 1277183003: Add ChromeVox panel and implement caption display functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN build 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js
index 2c7fa184355d6ca354350f710f5c58dd8273c7ae..a38d3b75dcfd09be1fc67631602dadf25149c574 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js
@@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-/** @fileoverview Sends braille content to a content script if the braille
- * captions feature is enabled.
+/** @fileoverview If the braille captions feature is enabled, sends
+ * braille content to the Panel on Chrome OS, or a content script on
+ * other platforms.
*/
goog.provide('cvox.BrailleCaptionsBackground');
+goog.require('PanelCommand');
goog.require('cvox.BrailleDisplayState');
goog.require('cvox.ExtensionBridge');
@@ -65,11 +67,17 @@ cvox.BrailleCaptionsBackground.setContent = function(text, cells) {
brailleChars += String.fromCharCode(
self.BRAILLE_UNICODE_BLOCK_START | byteBuf[i]);
}
- cvox.ExtensionBridge.send({
- message: 'BRAILLE_CAPTION',
- text: text,
- brailleChars: brailleChars
- });
+
+ if (cvox.ChromeVox.isChromeOS) {
+ var data = {text: text, braille: brailleChars};
+ (new PanelCommand(PanelCommandType.UPDATE_BRAILLE, data)).send();
+ } else {
+ cvox.ExtensionBridge.send({
+ message: 'BRAILLE_CAPTION',
+ text: text,
+ brailleChars: brailleChars
+ });
+ }
};

Powered by Google App Engine
This is Rietveld 408576698