From 3ae900471ae872880f07c2f69360ca4f7a5d0256 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Mon, 3 Oct 2011 10:36:07 -0700 Subject: [PATCH] Backed out 971f1bf573fc8 due to test failures --- browser/base/content/browser-context.inc | 4 --- browser/base/content/nsContextMenu.js | 29 ++----------------- .../base/content/test/test_contextmenu.html | 3 -- .../locales/en-US/chrome/browser/browser.dtd | 2 -- 4 files changed, 2 insertions(+), 36 deletions(-) diff --git a/browser/base/content/browser-context.inc b/browser/base/content/browser-context.inc index 3a04d825058..7bf483622e3 100644 --- a/browser/base/content/browser-context.inc +++ b/browser/base/content/browser-context.inc @@ -167,10 +167,6 @@ label="&saveAudioCmd.label;" accesskey="&saveAudioCmd.accesskey;" oncommand="gContextMenu.saveMedia();"/> - = this.target.HAVE_CURRENT_DATA; - this.setItemAttr("context-video-saveimage", "disabled", !canSaveSnapshot); - this.setItemAttr("context-video-fullscreen", "disabled", hasError); - } + if (this.onVideo) + this.setItemAttr("context-video-fullscreen", "disabled", hasError); } this.showItem("context-media-sep-commands", onMedia); }, @@ -830,27 +826,6 @@ nsContextMenu.prototype = { openUILink(viewURL, e, null, null, null, null, doc.documentURIObject ); }, - saveVideoFrameAsImage: function () { - urlSecurityCheck(this.mediaURL, this.browser.contentPrincipal, - Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT); - let name = ""; - try { - let uri = makeURI(this.mediaURL); - let url = uri.QueryInterface(Ci.nsIURL); - if (url.fileBaseName) - name = url.fileBaseName + ".jpg"; - } catch (e) { } - if (!name) - name = "snapshot.jpg"; - var video = this.target; - var canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); - canvas.width = video.videoWidth; - canvas.height = video.videoHeight; - var ctxDraw = canvas.getContext("2d"); - ctxDraw.drawImage(video, 0, 0); - saveImageURL(canvas.toDataURL("image/jpg", ""), name, "SaveImageTitle", true, false, document.documentURIObject); - }, - fullScreenVideo: function () { this.target.pause(); diff --git a/browser/base/content/test/test_contextmenu.html b/browser/base/content/test/test_contextmenu.html index e8824f3154a..eaec43ebbc2 100644 --- a/browser/base/content/test/test_contextmenu.html +++ b/browser/base/content/test/test_contextmenu.html @@ -339,7 +339,6 @@ function runTest(testNum) { "context-copyvideourl", true, "---", null, "context-savevideo", true, - "context-video-saveimage" true, "context-sendvideo", true, "---", null, "context-inspect", true]); @@ -358,7 +357,6 @@ function runTest(testNum) { "context-copyvideourl", true, "---", null, "context-savevideo", true, - "context-video-saveimage", false, "context-sendvideo", true, "---", null, "context-inspect", true]); @@ -377,7 +375,6 @@ function runTest(testNum) { "context-copyvideourl", false, "---", null, "context-savevideo", false, - "context-video-saveimage", false, "context-sendvideo", false, "---", null, "context-inspect", true]); diff --git a/browser/locales/en-US/chrome/browser/browser.dtd b/browser/locales/en-US/chrome/browser/browser.dtd index e749d660019..bbad0a1f60d 100644 --- a/browser/locales/en-US/chrome/browser/browser.dtd +++ b/browser/locales/en-US/chrome/browser/browser.dtd @@ -432,8 +432,6 @@ can reach it easily. --> - -