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

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

Issue 2563013003: Support audio ducking and suspension in ChromeVox (Closed)
Patch Set: Fix compile. Created 4 years 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/options.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js
index 4ae0143d5887f994f01b25420bb0219b4a406263..53fc20aa6191e7f457f80449809fe4aa64b6068e 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js
@@ -74,6 +74,20 @@ cvox.OptionsPage.init = function() {
localStorage['brailleSideBySide'] === 'true' ?
currentlyDisplayingSideBySide : currentlyDisplayingInterleave;
+ chrome.commandLinePrivate.hasSwitch('enable-default-media-session',
+ function(result) {
+ if (!result) {
+ $('audioStrategy').hidden = true;
+ $('audioDescription').hidden = true;
+ }
+ if (localStorage['audioStrategy']) {
+ for (var i = 0, opt; opt = $('audioStrategy').options[i]; i++) {
+ if (opt.id == localStorage['audioStrategy']) {
+ opt.setAttribute('selected', '');
+ }
+ }
+ }
+ });
Msgs.addTranslatedMessagesToDom(document);
cvox.OptionsPage.hidePlatformSpecifics();
@@ -340,6 +354,11 @@ cvox.OptionsPage.eventListener = function(event) {
cvox.OptionsPage.prefs.setPref(target.name, elements[i].value);
}
}
+ } else if (target.tagName == 'SELECT') {
+ var selIndex = target.selectedIndex;
+ var sel = target.options[selIndex];
+ var value = sel ? sel.id : 'audioNormal';
+ cvox.OptionsPage.prefs.setPref(target.id, value);
}
}
}, 0);

Powered by Google App Engine
This is Rietveld 408576698