Bug 1111146 - [EME] Implement master pref for playing DRM content. r=gijs

This commit is contained in:
Dão Gottwald 2015-01-29 13:49:01 +01:00
parent dbac71f391
commit 52f99c7354
5 changed files with 49 additions and 15 deletions

View File

@ -4,12 +4,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gContentPane = {
/**
* Initializes the fonts dropdowns displayed in this pane.
*/
init: function ()
{
// Initializes the fonts dropdowns displayed in this pane.
this._rebuildFonts();
var menulist = document.getElementById("defaultFont");
if (menulist.selectedIndex == -1) {
@ -23,6 +20,10 @@ var gContentPane = {
let row = document.getElementById("translationBox");
row.removeAttribute("hidden");
}
let drmInfoURL =
Services.urlFormatter.formatURLPref("app.support.baseURL") + "drm-content";
document.getElementById("playDRMContentLink").setAttribute("href", drmInfoURL);
},
// UTILITY FUNCTIONS

View File

@ -22,6 +22,9 @@
<preferences id="contentPreferences">
<!--XXX buttons prefs -->
<!-- DRM content -->
<preference id="media.eme.enabled" name="media.eme.enabled" type="bool"/>
<!-- POPUPS -->
<preference id="dom.disable_open_during_load" name="dom.disable_open_during_load" type="bool"/>
@ -50,6 +53,15 @@
<column/>
</columns>
<rows id="contentRows-1">
<row id="playDRMContentRow">
<vbox align="start">
<checkbox id="playDRMContent" preference="media.eme.enabled"
label="&playDRMContent.label;" accesskey="&playDRMContent.accesskey;"/>
</vbox>
<hbox pack="end">
<label id="playDRMContentLink" class="text-link" value="&playDRMContent.learnMore.label;"/>
</hbox>
</row>
<row id="popupPolicyRow">
<vbox align="start">
<checkbox id="popupPolicy" preference="dom.disable_open_during_load"
@ -57,9 +69,11 @@
onsyncfrompreference="return gContentPane.updateButtons('popupPolicyButton',
'dom.disable_open_during_load');"/>
</vbox>
<button id="popupPolicyButton" label="&popupExceptions.label;"
oncommand="gContentPane.showPopupExceptions();"
accesskey="&popupExceptions.accesskey;"/>
<hbox pack="end">
<button id="popupPolicyButton" label="&popupExceptions.label;"
oncommand="gContentPane.showPopupExceptions();"
accesskey="&popupExceptions.accesskey;"/>
</hbox>
</row>
</rows>
</grid>

View File

@ -3,10 +3,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
var gContentPane = {
/**
* Initializes the fonts dropdowns displayed in this pane.
*/
init: function ()
{
function setEventListener(aId, aEventType, aCallback)
@ -15,6 +11,7 @@ var gContentPane = {
.addEventListener(aEventType, aCallback.bind(gContentPane));
}
// Initializes the fonts dropdowns displayed in this pane.
this._rebuildFonts();
var menulist = document.getElementById("defaultFont");
if (menulist.selectedIndex == -1) {
@ -43,6 +40,10 @@ var gContentPane = {
gContentPane.openTranslationProviderAttribution);
setEventListener("translateButton", "command",
gContentPane.showTranslationExceptions);
let drmInfoURL =
Services.urlFormatter.formatURLPref("app.support.baseURL") + "drm-content";
document.getElementById("playDRMContentLink").setAttribute("href", drmInfoURL);
},
// UTILITY FUNCTIONS

View File

@ -6,6 +6,11 @@
<preferences id="contentPreferences" hidden="true" data-category="paneContent">
<!-- DRM content -->
<preference id="media.eme.enabled"
name="media.eme.enabled"
type="bool"/>
<!-- Popups -->
<preference id="dom.disable_open_during_load"
name="dom.disable_open_during_load"
@ -35,14 +40,21 @@
</hbox>
<groupbox id="miscGroup" data-category="paneContent" hidden="true">
<caption><label>&popups.label;</label></caption>
<grid id="contentGrid">
<columns>
<column flex="1"/>
<column/>
</columns>
<rows id="contentRows-1">
<row id="playDRMContentRow">
<vbox align="start">
<checkbox id="playDRMContent" preference="media.eme.enabled"
label="&playDRMContent.label;" accesskey="&playDRMContent.accesskey;"/>
</vbox>
<hbox pack="end">
<label id="playDRMContentLink" class="text-link" value="&playDRMContent.learnMore.label;"/>
</hbox>
</row>
<row id="popupPolicyRow">
<vbox align="start">
<checkbox id="popupPolicy" preference="dom.disable_open_during_load"
@ -50,8 +62,10 @@
onsyncfrompreference="return gContentPane.updateButtons('popupPolicyButton',
'dom.disable_open_during_load');"/>
</vbox>
<button id="popupPolicyButton" label="&popupExceptions.label;"
accesskey="&popupExceptions.accesskey;"/>
<hbox pack="end">
<button id="popupPolicyButton" label="&popupExceptions.label;"
accesskey="&popupExceptions.accesskey;"/>
</hbox>
</row>
</rows>
</grid>

View File

@ -42,3 +42,7 @@
-->
<!ENTITY translation.options.attribution.beforeLogo "Translations by">
<!ENTITY translation.options.attribution.afterLogo "">
<!ENTITY playDRMContent.label "Play DRM content">
<!ENTITY playDRMContent.accesskey "P">
<!ENTITY playDRMContent.learnMore.label "Learn more">