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

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.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/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 0d2183c970466678700f506f1af19fb32f677b3a..2bbf729cdb68d0b11943e77e54349e7af5f714f7 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,14 +2,16 @@
// 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('cvox.BrailleDisplayState');
goog.require('cvox.ExtensionBridge');
+goog.require('cvox.PanelCommand');
/**
* Key set in local storage when this feature is enabled.
@@ -65,11 +67,19 @@ 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) {
+ (new cvox.PanelCommand(
+ cvox.PanelCommandType.UPDATE_BRAILLE_TEXT, text)).send();
+ (new cvox.PanelCommand(
+ cvox.PanelCommandType.UPDATE_BRAILLE_CELLS, brailleChars)).send();
+ } else {
+ cvox.ExtensionBridge.send({
+ message: 'BRAILLE_CAPTION',
+ text: text,
+ brailleChars: brailleChars
+ });
+ }
};

Powered by Google App Engine
This is Rietveld 408576698