Bug 1150371 - [Part1] - Remove 'Learn more about Drm...' from r-click context menu if it's a MediaElement for clearkey content. r=florian

MozReview-Commit-ID: 2OrP7bM40pS

--HG--
extra : transplant_source : %9FN%84%7E%02%E8%F5%8A%40M%5C9%93%86%B4%A8%A4%85%01%9E
This commit is contained in:
Kilik Kuo 2016-08-06 17:33:11 +08:00
Родитель a14b337bab
Коммит 9d1d7f520e
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -735,7 +735,7 @@ nsContextMenu.prototype = {
if (this.isMediaURLReusable(mediaURL)) { if (this.isMediaURLReusable(mediaURL)) {
this.mediaURL = mediaURL; this.mediaURL = mediaURL;
} }
if (this.target.isEncrypted) { if (this._isProprietaryDRM()) {
this.onDRMMedia = true; this.onDRMMedia = true;
} }
// Firefox always creates a HTMLVideoElement when loading an ogg file // Firefox always creates a HTMLVideoElement when loading an ogg file
@ -754,7 +754,7 @@ nsContextMenu.prototype = {
if (this.isMediaURLReusable(mediaURL)) { if (this.isMediaURLReusable(mediaURL)) {
this.mediaURL = mediaURL; this.mediaURL = mediaURL;
} }
if (this.target.isEncrypted) { if (this._isProprietaryDRM()) {
this.onDRMMedia = true; this.onDRMMedia = true;
} }
} }
@ -968,6 +968,11 @@ nsContextMenu.prototype = {
return aNode.spellcheck; return aNode.spellcheck;
}, },
_isProprietaryDRM: function() {
return this.target.isEncrypted && this.target.mediaKeys &&
this.target.mediaKeys.keySystem != "org.w3.clearkey";
},
_openLinkInParameters : function (extra) { _openLinkInParameters : function (extra) {
let params = { charset: gContextMenuContentData.charSet, let params = { charset: gContextMenuContentData.charSet,
referrerURI: gContextMenuContentData.documentURIObject, referrerURI: gContextMenuContentData.documentURIObject,