From 2ffc877a0e725298df88f464d903298b1a213302 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Mon, 3 Oct 2011 20:47:41 -0700 Subject: [PATCH] Bug 669260 - Add statistics overlay to video element. r=dolske --- browser/base/content/browser-context.inc | 8 + browser/base/content/nsContextMenu.js | 16 ++ .../base/content/test/subtst_contextmenu.html | 6 +- .../base/content/test/test_contextmenu.html | 9 +- .../locales/en-US/chrome/browser/browser.dtd | 5 +- toolkit/content/widgets/videocontrols.css | 26 +++ toolkit/content/widgets/videocontrols.xml | 182 +++++++++++++++++- .../en-US/chrome/global/videocontrols.dtd | 15 ++ .../pinstripe/global/media/videocontrols.css | 19 ++ .../winstripe/global/media/videocontrols.css | 19 ++ 10 files changed, 297 insertions(+), 8 deletions(-) diff --git a/browser/base/content/browser-context.inc b/browser/base/content/browser-context.inc index 3a04d825058f..a4b7c8645d0a 100644 --- a/browser/base/content/browser-context.inc +++ b/browser/base/content/browser-context.inc @@ -105,6 +105,14 @@ label="&mediaHideControls.label;" accesskey="&mediaHideControls.accesskey;" oncommand="gContextMenu.mediaCommand('hidecontrols');"/> + + = this.target.HAVE_CURRENT_DATA; this.setItemAttr("context-video-saveimage", "disabled", !canSaveSnapshot); this.setItemAttr("context-video-fullscreen", "disabled", hasError); + this.setItemAttr("context-video-showstats", "disabled", hasError); + this.setItemAttr("context-video-hidestats", "disabled", hasError); } } this.showItem("context-media-sep-commands", onMedia); @@ -1436,6 +1442,16 @@ nsContextMenu.prototype = { case "showcontrols": media.setAttribute("controls", "true"); break; + case "showstats": + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("media-showStatistics", false, true, true); + media.dispatchEvent(event); + break; + case "hidestats": + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("media-showStatistics", false, true, false); + media.dispatchEvent(event); + break; } }, diff --git a/browser/base/content/test/subtst_contextmenu.html b/browser/base/content/test/subtst_contextmenu.html index 3b5829e8fcfb..95fbae1bcaa6 100644 --- a/browser/base/content/test/subtst_contextmenu.html +++ b/browser/base/content/test/subtst_contextmenu.html @@ -12,9 +12,9 @@ Browser context menu subtest.
- - -